Mercurial > hg > xemacs-beta
changeset 5511:7b5254f6e0d5
Fix CL compliance of [symbol-]macrolet.
-------------------- ChangeLog entries follow: --------------------
lisp/ChangeLog addition:
2011-05-25 Didier Verna <didier@xemacs.org>
* 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.
author | Didier Verna <didier@xemacs.org> |
---|---|
date | Wed, 25 May 2011 14:01:38 +0200 |
parents | 6b3caa55668c |
children | 4aa8ee813265 |
files | lisp/ChangeLog lisp/cl-macs.el |
diffstat | 2 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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 <didier@xemacs.org> + + * 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 <kehoea@parhasard.net> * cl-macs.el (bind-inits)): Removed.
--- 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))