Steven @StevenXL
There are two great resources out there for learning Elixir's metaprogramming capabilities - @chrismccord's Metaprogramming Elixir and @sasajuric's Understanding Elixir Macros mini-series.
Write code that writes code with Elixir macros. Macros make metaprogramming possible and define the language itself.
In this book, you’ll learn how to use macros to extend the language with fast, maintainable code and share functionality in ways you never thought possible. You’ll discover how to extend Elixir with your own first-class features, optimize performance, and create domain-specific languages.
Steven @StevenXL
There are two great resources out there for learning Elixir's metaprogramming capabilities - @chrismccord's Metaprogramming Elixir and @sasajuric's Understanding Elixir Macros mini-series.
Myronmarston @myronmarston
@josevalim I think there's a bit of a whole in the documentation regarding this stuff. I've read @chrismccord's Metaprogramming Elixir and the Elixir docs regarding macros and quote and I don't really think it provides the necessary concepts to understand this kind of issue (at least not for how my brain thinks, apparently). Are there some simple ways we can improve the docs regarding this? I'm thinking maybe a doc explaining macro expansion phases in more detail and how evaluation order may not match what you'd expect. And also maybe the docs on the Module attribute functions could mention this gotcha. It definitely surprised me.
@hotpancakes
I've been reading Chris's excellent "Metaprogramming Elixir" and "Designing for Scalability with Erlang/OTP". It got me wondering, how long does it typically take you to read a technical book?
Jeff Deville @jeffdeville
I was following (I hope) Chris's guidelines in Metaprogramming Elixir, so I have the overall macro split across multiple files.
Jeff Deville @jeffdeville
This compiles, but none of my methods are defined. It seems wrong that my AST is a list, and not a tree, but the same is true for the Translator module from Metaprogramming Elixir, and it's still working. I suppose this isn't the top of the tree anyway.
Brian van Burken @brianvanburken
I also recommend to read Metaprogramming Elixir by Chris McCord (the person who build the Phoenix framework) https://pragprog.com/book/cmelixir/metaprogramming-elixir.
@uri
Originally I got the idea to do this from Chris McCord's Metaprogramming Elixir, but is there a better way to handle this?
Norbert Melzer @NobbZ
If you want to go deeper into macros and metaprogramming, I'd suggest to read Metaprogramming Elixir by @chrismccord.
Christiansakai @christiansakai
* Metaprogramming Elixir
Jonathan Soifer @jaysoifer
• Metaprogramming Elixir (USD 14.88)
Johan Wärlander @jwarlander
Metaprogramming Elixir
Kien Nguyen Trung @kiennt
@sashaafm you could read more about this technique in the book "Metaprogramming Elixir", chapter 3
Mike Buhot @mbuhot
Metaprogramming Elixir
Olivier Boudry @oboudry
I'm reading and playing around the PragProg book Metaprogramming Elixir.
Olivier Boudry @oboudry
It's on my reading list right after finishing "Metaprogramming Elixir". Can't wait to learn more on OTP!
Willie Loh @willieLOH
* Metaprogramming Elixir
Sasha Fonseca @sashaafm
The Metaprogramming Elixir book also doesn't cover this aspect of testing macros, I believe.
Dina @soundstruck
I have Metaprogramming Elixir, but need to come back to that one.
Aston @AstonJ
Metaprogramming Elixir
Aston @AstonJ
Metaprogramming Elixir
Aston @AstonJ
Metaprogramming Elixir
@Crowdhailer
Any pointers would be greatly received or some resources to some more advanced macro tutorial, so far I have read Metaprogramming Elixir and looked at the Plug source code but to no avail
Norbert Melzer @NobbZ
And of course there is the book "Metaprogramming Elixir" by @chrismccord, published by pragmatic bookstore.
@peerreynders
Metaprogramming Elixir
Voger @voger
I just finished "Programming Elixir" and now I am reading "Metaprogramming Elixir". I can't say I comprehend everything.
Sasha Fonseca @sashaafm
I forgot I also got Metaprogramming Elixir.