[Added import-macros-from-lisp that bring lisp macros into the js macroexpansion attila.lendvai@gmail.com**20060512152954] { hunk ./src/js.lisp 225 +(defun undefine-js-compiler-macro (name) + (declare (type symbol name)) + (when (gethash (symbol-name name) *js-compiler-macros*) + (warn "Redefining compiler macro ~S" name) + (remhash (symbol-name name) *js-compiler-macros*))) + hunk ./src/js.lisp 264 - (when (gethash (symbol-name name) *js-compiler-macros*) - (warn "Redefining compiler macro ~S" name) - (remhash (symbol-name name) *js-compiler-macros*)) hunk ./src/js.lisp 265 + (undefine-js-compiler-macro name) hunk ./src/js.lisp 268 - (destructuring-bind ,args ,lambda-list ,@body))))) + (destructuring-bind ,args ,lambda-list ,@body))))) + +(defun import-macros-from-lisp (&rest names) + "Import the named lisp macros into the js macro expansion" + (dolist (name names) + (undefine-js-compiler-macro name) + (setf (gethash (symbol-name name) *js-macro-toplevel*) + (lambda (&rest args) + (macroexpand `(,name ,@args)))))) hunk ./src/package.lisp 132 + #:import-macros-from-lisp }