The pillars of Metaprogramming in Elixir
summary
Elixir metaprogramming rests on three concrete mechanisms: quoted literals, macros, and compile-time callbacks — the talk demonstrates how quoted ASTs (three-element tuples), var vs unquote hygiene, and code.eval_quoted work; shows using defmacro/using to inject functions cleanly; and implements a before_compile-based reflection to list Phoenix controller plugs so tests can assert plug usage rather than runtime behavior. Examples include Ecto schema reflection and a working controller-plug introspection that simplifies testing.
AI-written summary · about
chapters (7)
- 0:00Start
- 17:00CODE INJECTION (THE BAD WAY)
- 18:44MACRO EXAMPLE
- 19:55CODE INJECTION (THE GOOD WAY)
- 27:31EXAMPLE II: PHOENIX.CONTROLLER
- 29:04TESTING (USAGE)
- 33:42SUMMARY








