3 ms·
Yeah, 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
by dschiptsov 12y ago
Yeah, 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.)