Mercurial > hg > xemacs-beta
diff lisp/cl-macs.el @ 5553:62edcc6a11ec
Add an assertion about argument order to #'apply-partially compiler macro
lisp/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea@parhasard.net>
* cl-macs.el (apply-partially):
Add an assertion to this compiler macro, requiring that the order
of the placeholders corresponding to the arguments in the
constants vector of the constructed compiled function be the same
as the order of the arguments to #'apply-partially.
tests/ChangeLog addition:
2011-08-24 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
Add a test of apply partially that depends on the relative order
of its arguments.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 24 Aug 2011 11:06:41 +0100 |
parents | b908c7265a2b |
children | 9a93bc90b3bd |
line wrap: on
line diff
--- a/lisp/cl-macs.el Fri Aug 12 16:02:30 2011 +0100 +++ b/lisp/cl-macs.el Wed Aug 24 11:06:41 2011 +0100 @@ -3519,6 +3519,13 @@ (let* ((placeholders (mapcar 'quote-maybe (mapcar 'gensym args))) (compiled (byte-compile-sexp `#'(lambda (&rest args) (apply ,@placeholders args))))) + (assert (equal (intersection + (mapcar 'quote-maybe (compiled-function-constants + compiled)) + placeholders :test 'equal :stable t) + placeholders) + t "This macro requires that the relative order is the same\ +in the constants vector and in the arguments") `(make-byte-code ',(compiled-function-arglist compiled) ,(compiled-function-instructions compiled)