3 ms·
If macros are agreed by all Lisp users to be a "use rarely" thing, then why is internet Lisp advocacy so strongly focused on macros as an advantage of Lisp over
by pekk 12y ago
If macros are agreed by all Lisp users to be a "use rarely" thing, then why is internet Lisp advocacy so strongly focused on macros as an advantage of Lisp over the rest of the world?
- sls 12y agoRarely isn't never. I'd join in the recommendation above to read pg's "On Lisp" to get a sense of the sort of things one can accomplish with a few small macros. But just as a sampler, if your language has a preprocessor phase where source code is manipulated by source code you provide, you can add control structures. Maybe your language has a loop construct but no way to iterate through a collection without explicit indices. You can add that, and it will be a first-class control structure that gets to control evaluation and everything. You do not have to file a feature request and drum up support and wait five years to get it.
- lostcolony 12y agoTo give an analogy (not a great one, but a reasonable one), think of reflection on the JVM. Is it something to use all the time (even if it was fast)? No. Is it incredibly powerful and incredibly useful for certain classes of problems? Yes. Is it a strong advantage for languages with reflection vs those that have nothing comparable? Yes.