Chapter 2Extending Elixir with Metaprogramming

Macros aren’t just limited to the simple transformations you’ve done so far. They can be used to perform powerful code generation, save time, eliminate boilerplate, and produce elegant APIs. Once you realize that most of the Elixir standard library is implemented as macros, the possibilities really click about just how much freedom you have to extend the language. This can turn your language wish lists into immediate realities. Throughout this chapter, you’ll find out how.

To continue our journey, we’ll add brand-new control flow features to Elixir, extend the module system, and create a testing framework. Elixir puts all the building blocks of the language at our fingertips. It’s time to start ...

Get Metaprogramming Elixir now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.