I still develop my Julia macros by trial and error, and since they are a bit different from Common Lisp macros, I am realizing that I need to learn a different way for idiomatic usage. The principle is the same as in CL, but hygiene is implemented differently, and there are subtle issues (like no equivalent for
&body macros, eg one could not reimplement
if with macros if they weren’t part of the language). Nevertheless, I am convinced that Julia macros are powerful, I just need to learn the right way to use them.
I am wondering if I could get
- Recommendations for examples which I could study to learn about good practices and elegant use of macros, eg in some package code that uses macros elegantly,
- Pointers for open issues and corner cases which I should watch out for.
I have read the manual, but it is of course just a short introduction of concepts. Feel free to push your own packages/blog posts