# HG changeset patch # User Didier Verna # Date 1306324898 -7200 # Node ID 7b5254f6e0d5247c83186b4599e7e428baa463d4 # Parent 6b3caa55668cdb3df50e0a56620ae5e60b43e593 Fix CL compliance of [symbol-]macrolet. -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2011-05-25 Didier Verna * cl-macs.el (macrolet): * cl-macs.el (symbol-macrolet): Don't require one mandatory [symbol-]macro definition in the first argument. The Common Lisp standard allows the list of definitions to be empty. diff -r 6b3caa55668c -r 7b5254f6e0d5 lisp/ChangeLog --- a/lisp/ChangeLog Fri May 20 12:16:42 2011 +0100 +++ b/lisp/ChangeLog Wed May 25 14:01:38 2011 +0200 @@ -1,3 +1,10 @@ +2011-05-25 Didier Verna + + * cl-macs.el (macrolet): + * cl-macs.el (symbol-macrolet): Don't require one mandatory + [symbol-]macro definition in the first argument. The Common Lisp + standard allows the list of definitions to be empty. + 2011-05-18 Aidan Kehoe * cl-macs.el (bind-inits)): Removed. diff -r 6b3caa55668c -r 7b5254f6e0d5 lisp/cl-macs.el --- a/lisp/cl-macs.el Fri May 20 12:16:42 2011 +0100 +++ b/lisp/cl-macs.el Wed May 25 14:01:38 2011 +0200 @@ -1769,29 +1769,27 @@ ;; The following ought to have a better definition for use with newer ;; byte compilers. ;;;###autoload -(defmacro* macrolet (((name arglist &optional docstring &body body) - &rest macros) &body form) +(defmacro* macrolet ((&rest macros) &body form) "Make temporary macro definitions. This is like `flet', but for macros instead of functions." (cl-macroexpand-all (cons 'progn form) (nconc (loop for (name . details) - in (cons (list* name arglist docstring body) macros) + in macros collect (list* name 'lambda (cdr (cl-transform-lambda details name)))) cl-macro-environment))) ;;;###autoload -(defmacro* symbol-macrolet (((name expansion) &rest symbol-macros) &body form) - "Make symbol macro definitions. -Within the body FORMs, references to the variable NAME will be replaced -by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...)." - (check-type name symbol) +(defmacro* symbol-macrolet ((&rest symbol-macros) &body form) + "Make temporary symbol macro definitions. +Elements in SYMBOL-MACROS look like (NAME EXPANSION). +Within the body FORMs, a reference to NAME is replaced with its EXPANSION, +and (setq NAME ...) acts like (setf EXPANSION ...)." (cl-macroexpand-all (cons 'progn form) - (nconc (list (list (eq-hash name) expansion)) - (loop + (nconc (loop for (name expansion) in symbol-macros do (check-type name symbol) collect (list (eq-hash name) expansion))