X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fdefbangmacro.lisp;h=723a04e609f55752729212cf1a4f782a95de9b01;hb=7f1e94ae961a198e00daf281eb1dc858e5b2dcc7;hp=f0e40e8883b3673e132367a4ae56a98ecf9561c3;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/code/defbangmacro.lisp b/src/code/defbangmacro.lisp index f0e40e8..723a04e 100644 --- a/src/code/defbangmacro.lisp +++ b/src/code/defbangmacro.lisp @@ -17,16 +17,13 @@ (in-package "SB!IMPL") -(file-comment - "$Header$") - #+sb-xc-host (progn ;; a description of the DEF!MACRO call to be stored until we get enough ;; of the system running to finish processing it (defstruct delayed-def!macro - (args (required-argument) :type cons) - (package *package* :type package)) + (args (missing-arg) :type cons) + (package (sane-package) :type package)) ;; a list of DELAYED-DEF!MACROs stored until we get DEF!MACRO working fully ;; so that we can apply it to them. After DEF!MACRO is made to work, this ;; list is processed, and then should no longer be used; it's made unbound in @@ -41,12 +38,12 @@ (defmacro def!macro (name &rest rest) #-(or sb-xc-host sb-xc) `(defmacro ,name ,@rest) #+sb-xc-host `(progn - (defmacro ,name ,@rest) - ,(let ((uncrossed-args `(,(uncross name) ,@rest))) - (if (boundp '*delayed-def!macros*) - `(push (make-delayed-def!macro :args ',uncrossed-args) - *delayed-def!macros*) - `(sb!xc:defmacro ,@uncrossed-args)))) + (defmacro ,name ,@rest) + ,(let ((uncrossed-args `(,(uncross name) ,@rest))) + (if (boundp '*delayed-def!macros*) + `(push (make-delayed-def!macro :args ',uncrossed-args) + *delayed-def!macros*) + `(sb!xc:defmacro ,@uncrossed-args)))) ;; When cross-compiling, we don't want the DEF!MACRO to have any ;; effect at compile time, because (1) we already defined the macro ;; when building the cross-compiler, so at best it would be redundant @@ -65,9 +62,9 @@ (if (boundp '*delayed-def!macros*) (progn (mapcar (lambda (x) - (let ((*package* (delayed-def!macro-package x))) - (eval `(sb!xc:defmacro ,@(delayed-def!macro-args x))))) - (reverse *delayed-def!macros*)) + (let ((*package* (delayed-def!macro-package x))) + (eval `(sb!xc:defmacro ,@(delayed-def!macro-args x))))) + (reverse *delayed-def!macros*)) ;; We shouldn't need this list any more. Making it unbound serves as a ;; signal to DEF!MACRO that it needn't delayed DEF!MACROs any more. ;; It is also generally a good thing for other reasons: it frees