3 ms·
Macros can be de-mystified with proper editor support. In Emacs and Lisp you can (recursively) use "macroexpand" to see what code it produces in-place. I am not
by natrys 5y ago
Macros can be de-mystified with proper editor support. In Emacs and Lisp you can (recursively) use "macroexpand" to see what code it produces in-place. I am not an Elixir user (though thinking about hopping on), apparently there is alchemist.el[1] that lets you do that (with caveat, and the project seems dead tbh).
[1] https://github.com/tonini/alchemist.el https://github.com/tonini/alchemist.el
- lukaszsamson 5y agoMacro expansion has recently been added to elixir-ls[1] and is supported via custom command in vscode extension. [1] https://github.com/elixir-lsp/elixir-ls https://github.com/elixir-lsp/elixir-ls
- elcritch 5y agoThat’d be really handy! It’d make Phoenix that much more approachable. With good editor support, I much prefer macros to runtime OOP magic/design patterns.
- natrys 5y agoThat's awesome! Now, what needs to happen for this to be supported in generic LSP clients like Emacs lsp-mode/eglot or nvim-lsp?