I wonder if there should be two reference guides: one for Developers who don’t want to write macros and one for Developers who want to write macros, maybe titled something like:
-
Reference for Developers who don’t like LISP or don’t know what it is, which basically describes elixir like if it were python. After all, it has
def,if,with,Enum.reduce_while(basically a pythonforloop that doesn’t leak outside the scope).defmacrodoes not exist and the|>operator is a special form that does magic with your functions to put the arguments in the right place. Modules are like classes that have no internal state and can’t be instantiated, unless they inherit (sorry, use! they use!) GenServers and you mess with something arcane like the process registry. Then you get gets and sets and mutable internal object state. Ok, I’ll stop now
-
Reference for Developers who think that LISP is the best thing ever and that the characters that compose the program are mere distractions from the holy truth of the AST, which describes elixir as if it were LISP and in which after chapter 2 all programs are written directly by manipulating the AST using functions (
do ... end?defmacro? who needs them? We write our AST directly!)
Despite the joking nature of these titles, and the parody-like description, I’m being serious, and I’d totally buy a book like number two if someone were to write it. And if @rvirding’s right, then reference #1 might be useful for many people too.


















