define-script-symbol-macro added
authorRed Daly <reddaly@gmail.com>
Sat, 28 Jul 2007 17:49:20 +0000 (17:49 +0000)
committerRed Daly <reddaly@gmail.com>
Sat, 28 Jul 2007 17:49:20 +0000 (17:49 +0000)
src/parser.lisp

index 10ed65b..2b19fe8 100644 (file)
@@ -415,6 +415,13 @@ macro environment."
                       ,lambda-list
                     ,@body))))))
 
+(defmacro define-script-symbol-macro (name expansion)
+  "Define a ParenScript symbol macro, and store it in the toplevel ParenScript
+macro environment."
+  (undefine-script-special-form name)
+  `(setf (get-macro-spec ',name *script-macro-toplevel*)
+    (cons t (lambda () ,expansion))))
+
 (defun import-macros-from-lisp (&rest names)
   "Import the named Lisp macros into the ParenScript macro
 environment. When the imported macro is macroexpanded by ParenScript,