I get that it works, and it's actually pretty cool that you can do this. But honestly, it feels like it would good, readable code into a tangled mess pretty fast.
I get that it works, and it's actually pretty cool that you can do this. But honestly, it feels like it would good, readable code into a tangled mess pretty fast.
> it feels like it would good, readable code into a tangled mess pretty fast
It definitively can, no doubt about it. But used sparingly and only when there is no other way, it can help you remove enormous amount of boilerplate and other things, in a relatively simple, fast and safe way. In my codebases, it does lead to a lot less code, even when most projects just have 2 or 3 macros at most.
Just as one basic example that comes to mind just because I had to do it today: imagine you have a testing suite. When some assertion fails, you'd like to display what value was expected, what value it actually got, and what the exact code was. In JavaScript, I think the most you'd be able to get without involving 3rd party compilers, reading source code from disk or whatnot, would be some functions name (`myfn.toString()`), while in Clojure your macro could capture the entire source code within it, and print it, trivially.
Basically, if you want a function that can take the arguments without evaluating them before executing it, you can do so with macros but without macros you cannot do that. Personally, being able to do so leads to me finding simpler solutions, and expressing them in better ways, compared to if I didn't have them available.