Table of Contents
Acknowledgements |
Introduction |
Metaprogramming—An Essential Feature |
How to Read This Book |
Running the Code Exercises |
Online Resources |
1. | The Language of Macros |
The World Is Your Playground |
Macro Rules |
The Abstract Syntax Tree—Demystified |
Macros: The Building Blocks of Elixir |
Code Injection and the Caller’s Context |
Further Exploration |
2. | Extending Elixir with Metaprogramming |
Custom Language Constructs |
Smarter Testing with Macros |
Extending Modules |
Using Module Attributes for Code Generation |
Compile-Time Hooks |
Further Exploration |
3. | Advanced Compile-Time Code Generation |
Generating Functions from External Data |
MIME-Type Conversion in Ten Lines of Code |
Building an Internationalization Library |
Code Generation from Remote APIs |
Further Exploration |
4. | How to Test ... |
Get Metaprogramming Elixir now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.