3 ms·
Yeah! Even more so if you have first-class macros (fexprs) like say Kernel does. I had a lot of fun building a fexpr-based lisp-1 with quasiquote (which Kernel
by akkartik 10y ago
Yeah! Even more so if you have first-class macros (fexprs) like say Kernel does. I had a lot of fun building a fexpr-based lisp-1 with quasiquote (which Kernel eschews) and also with a first-class apply that works on both functions and macros. Not even Kernel can do that.
$ git clone https://github.com/akkartik/wart
$ cd wart
$ ./wart
ready! type in an expression, then hit enter twice. ctrl-d exits.
mac (foo x)
`(+ ,x 1)
=> (object function {sig, body})
(foo 3)
=> 4
(foo @(list 3)) # apply analogous to the ,@ splice operator
=> 4
(foo @'(3))
=> 4
More info at http://akkartik.name/post/wart http://akkartik.name/post/wart. Lots of example programs at http://rosettacode.org/wiki/Category:Wart http://rosettacode.org/wiki/Category:Wart.
- deleted 10y ago[deleted]