| My latest iteration of lisp->javascript is itself written in JavaScript [1]. Macros are a must, but I'm starting to doubt that this language can (or should) support full-fledged quasiquotation. How can you have macros without quasiquotion? Well, there are a great deal of useful macros that follow this general pattern: (mac foo (x y . body)
`(bar ,x ,y ,@body))
The entire definition body is backquoted with each occurrence of the parameters comma'd out. I've started implementing LavaScript's macro system with the macro itself serving as a sort of dilluted quasiquote, based on the above pattern. In this system, you would write that macro as follows: (mac foo (x y body...)
(bar x y @body))
It assumes that the entire definition body is backquoted, and it assumes that every occurrence of the parameters is unquoted. So you don't need to notate all that explicitly in your macro definitions. On the other hand, you don't have a choice. You must sacrifice all the other interesting macrological possibilities, such as nested backquote expressions.I don't know if this is going to be work. The approach apparently wouldn't support gensyms, which could be a showstopper. I just started going down this path tonight and wanted to share / seek some feedback. If it wasn't clear, the body... is just different syntactic sugar for rest parameters. LavaScript doesn't have true conses at the moment, so I don't want to tease by invoking dotted pair notation. --- [1] It's called LavaScript :P https://github.com/evanrmurphy/lava-script |