3 ms·
Well, one can get quite far without writing macros. SICP for example writes (almost) no macros. Norvig himself has written only a few macros for his book PAIP.
by lispm 12y ago
Well, one can get quite far without writing macros.
SICP for example writes (almost) no macros. Norvig himself has written only a few macros for his book PAIP.
- dschiptsov 12y agoYeah, having high-order functions gives you the ability to write "a primitive" DSL, which is the one of the big ideas from SICP. The limitation is that all the arguments to your high-order function will be evaluated before its application, so if you need a special form (with its own evaluation rule) you have to write a "short-circuiting" macro transformation. This is how to write "advanced" DSLs. Almost a 2/3 of Arc are macros, but, yes, there are very few "special forms" among them. As for PAIP, he loves structs and looping DSLs, while, at least for me, the beauty is hidden in explicit recursive calls for traversing a recursive data-structures (lists, trees, graphs) made out of conses. I'm Brian Harvey's man.)