Move undefine-js-compiler-macro into an eval-when.
authorAttila Lendvai <attila.lendvai@gmail.com>
Sat, 13 May 2006 09:30:31 +0000 (09:30 +0000)
committerAttila Lendvai <attila.lendvai@gmail.com>
Sat, 13 May 2006 09:30:31 +0000 (09:30 +0000)
Reported by: William Halliburton <whalliburton@gmail.com>

src/js.lisp

index d81d239..90d1304 100644 (file)
   (defvar *js-compiler-macros* (make-hash-table :test 'equal)
         "*JS-COMPILER-MACROS* is a hash-table containing the functions corresponding
 to javascript special forms, indexed by their name. Javascript special
-forms are compiler macros for JS expressions."))
+forms are compiler macros for JS expressions.")
+
+  (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*))))
 
 (defmacro define-js-compiler-macro (name lambda-list &rest body)
   "Define a javascript compiler macro NAME. Arguments are destructured
@@ -222,12 +228,6 @@ to the ongoing javascript compilation."
       (defun ,js-name ,lambda-list ,@body)
       (setf (gethash ,(symbol-name name) *js-compiler-macros*) #',js-name))))
 
-(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*)))
-
 (defun js-compiler-macro-form-p (form)
   (when (and (symbolp (car form))
              (gethash (symbol-name (car form)) *js-compiler-macros*))