An open API service indexing awesome lists of open source software.

https://github.com/shmink/metaprogramming-elixir

Notes and examples I create whilst covering the book.
https://github.com/shmink/metaprogramming-elixir

book elixir examples metaprogramming notes

Last synced: 12 months ago
JSON representation

Notes and examples I create whilst covering the book.

Awesome Lists containing this project

README

          

# Metaprogamming Elixir

## by Chris McCord (author of the Phoenix framework)

_Write less code, get more done (and have fun!)_ :purple_heart:

[![codebeat badge](https://codebeat.co/badges/69f4818d-55a7-41bf-b642-4350f5885ab4)](https://codebeat.co/projects/github-com-shmink-metaprogramming-elixir-master)

### Abstract

Reading this book to learn about how macros work and following some of the relevant
examples. This README will serve as my notes, therefore you shouldn't take them at face
value as the notes will make sense for me as I cherry pick a sentence or an analogy.
Moreover, don't expect direct quotes, changing the sentences vocbulary helps me personally.

### Contents

- [Chapter 1 - The Language of Macros](chapters/chapter1.md)

- [What are Macros?](chapters/chapter1.md#what-are-macros)
- [The Abstract Syntax Tree](chapters/chapter1.md#the-abstract-syntax-tree)
- [Trying It All Together](chapters/chapter1.md#trying-it-all-together)
- [Macro Rules](chapters/chapter1.md#macro-rules)
- [The Abstract Syntax Tree - Demystified](chapters/chapter1.md#the-abstract-syntax-tree-demystified)
- [High-Level Syntax vs. Low-level AST](chapters/chapter1.md#high-level-syntax-vs-low-level-ast)
- [AST Literals](chapters/chapter1.md#ast-literals)
- [Macros: The Building Blocks of Elixir](chapters/chapter1.md#macros-the-building-blocks-of-elixir)
- [Macro Expansion](chapters/chapter1.md#macro-expansion)
- [Code Injection and the Caller's Context](chapters/chapter1.md#code-injection-and-the-callers-context)

- [Chapter 2 - Extending Elixir with Metaprogramming](chapters/chapter2.md)

- [Re-Creating the if Macro](chapters/chapter2.md#re-creating-the-if-macro)
- [Adding a while Loop to Elixir](chapters/chapter2.md#adding-a-while-loop-to-elixir)
- [Smarter Testing with Macros](chapters/chapter2.md#smarter-testing-with-macros)
- [Extending Modules](chapters/chapter2.md#extending-modules)
- [Using Module Attributes for Code Generation](chapters/chapter2.md#using-module-attributes-for-code-generation)
- [Compile-Time Hooks](chapters/chapter2.md#compile-time-hooks)

- [Chapter 3 - Advanced Compile-Time Code Generation](chapters/chapter3.md)