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

You can now keep your macros well tested and well specified. Your testing skills will help you balance the complexity macros introduce with the payoff they provide in productivity and power. Apply the skills you’ve seen here, and don’t worry too much about the testing methodologies you should use. Well-tested code is the goal; just make sure you make it happen.

Next, we’ll create a full-featured domain-specific language. But first, try expanding your testing skills and have a little fun. Here are a couple of ideas to get you started.

  • Let’s get meta. Use your Assertion.assert macro to test your Translator and Loop macros. Instead of ExUnit, rewrite all the tests in this chapter to use our mini Assertion test framework. Our ...

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