3 ms·
This does not match my experience. I write macros to make my code shorter when I notice a repeating pattern. To see what the macros do, I use macroexpand. Is de
by gruseom 13y ago
This does not match my experience. I write macros to make my code shorter when I notice a repeating pattern. To see what the macros do, I use macroexpand. Is debugging a problem? Well, I understand the macroexpansions so I can read them when I need to—so no, it's not that big a problem. You're not the first Clojure person I've heard talk this way about macros, and I don't understand why anyone would be so eager to deprecate such a powerful technique. Especially since it actually works (and works well) in Lisps, and not nearly as well elsewhere.
Also, these comments seem odd:
A properly done (and properly used) macro
The big problem is not macros, but code which uses macros.
The macros I know are effectively impossible to misuse. They tell you how they're supposed to be used and you just do it. There's not a lot of room to go wrong! Can you give an example of a macro which is hard to use properly?
- kaoD 13y ago> I write macros to make my code shorter when I notice a repeating pattern. I do that using functions :)