From 8a80babd85405d68709b4030c0ac37a41695f3c0 Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Tue, 19 Jun 2007 18:44:51 +0000 Subject: [PATCH] Added the defmacro/js macro-defining macro. --- src/js.lisp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js.lisp b/src/js.lisp index 94973c0..2282ff6 100644 --- a/src/js.lisp +++ b/src/js.lisp @@ -259,15 +259,20 @@ this macro." (list *js-macro-toplevel*)))))))) (defmacro defjsmacro (name args &rest body) - "Define a javascript macro, and store it in the toplevel macro environment." + "Define a ParenScript macro, and store it in the toplevel macro environment." (let ((lambda-list (gensym))) (undefine-js-compiler-macro name) `(setf (gethash ,(symbol-name name) *js-macro-toplevel*) #'(lambda (&rest ,lambda-list) (destructuring-bind ,args ,lambda-list ,@body))))) +(defmacro defmacro/js (name args &body body) + "Define a Lisp macro and import it into the ParenScript macro environment." + `(progn (defmacro ,name ,args ,@body) + (js:import-macros-from-lisp ',name))) + (defun import-macros-from-lisp (&rest names) - "Import the named lisp macros into the js macro expansion" + "Import the named Lisp macros into the ParenScript macro environment." (dolist (name names) (let ((name name)) (undefine-js-compiler-macro name) -- 2.11.4.GIT