Elixir Blog Post: Conditional context for macros

Blogged on how to use __CALLER__.context and __CALLER__.context_modules to build macros, which behaviour depends on the context (different/extended abilities when in guard, when in match, elsewhere.)

https://rocket-science.ru/hacking/2021/02/13/conditional-context


Posted via Devtalk (see this thread for details).

3 Likes

It is not clear at the end of the article, what context_modules holds.

1 Like

Thank you, indeed, added with an example.

1 Like

Thank you. It is clear now.

2 Likes