O'Reilly logo

Metaprogramming Elixir by Chris McCord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Further Exploration

We journeyed from simple control flow transformations all the way through a mini testing framework. Along the way, you learned all the tools necessary to define your own macros and perform AST transformations in a responsible way. Next, we’ll discover a few advanced compile-time code-generation techniques to create highly performant and maintainable programs.

On your own, explore ways you can enhance your Assertion test framework and define new macro constructs. Here are a few basic experiments to get you started:

  • Implement assert for every operator in Elixir.

  • Add Boolean assertions, such as assert true.

  • Implement a refute macro for refutations.

And some that are more advanced:

  • Run test cases in parallel within Assertion.Test.run/2 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required