How can I simulate macros in JavaScript?
A library by Mozilla (called SweetJS) is designed to simulate macros in JavaScript. For example, you can use SweetJS to replace the function
keyword with def
.
One can also now use ClojureScript to compile clojure to javascript and get macros that way. Note ClojureScript uses Google Closure.