APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1300710427 0
# Node ID 919c77c567bb82e43065c057122af0ff97ed6907
# Parent a32a108ae8156a56b45e541414ec06f80bd65efb
Add compiler macros for #'revappend, #'nreconc.
2011-03-21 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (revappend, nreconc):
Add compiler macros for these two functions. (They used to be
inline, but that involves needless binding of the arguments.)
diff -r a32a108ae815 -r 919c77c567bb lisp/ChangeLog
--- a/lisp/ChangeLog Mon Mar 21 12:19:25 2011 +0000
+++ b/lisp/ChangeLog Mon Mar 21 12:27:07 2011 +0000
@@ -1,3 +1,9 @@
+2011-03-21 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (revappend, nreconc):
+ Add compiler macros for these two functions. (They used to be
+ inline, but that involves needless binding of the arguments.)
+
2011-03-21 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (cl-non-fixnum-number-p):
diff -r a32a108ae815 -r 919c77c567bb lisp/cl-macs.el
--- a/lisp/cl-macs.el Mon Mar 21 12:19:25 2011 +0000
+++ b/lisp/cl-macs.el Mon Mar 21 12:27:07 2011 +0000
@@ -3710,6 +3710,12 @@
(define-compiler-macro pairlis (a b &optional c)
`(nconc (mapcar* #'cons ,a ,b) ,c))
+(define-compiler-macro revappend (&whole form &rest args)
+ (if (eql 3 (length form)) `(nconc (reverse ,(pop args)) ,(pop args)) form))
+
+(define-compiler-macro nreconc (&whole form &rest args)
+ (if (eql 3 (length form)) `(nconc (nreverse ,(pop args)) ,(pop args)) form))
+
(define-compiler-macro complement (&whole form fn)
(if (or (eq (car-safe fn) 'function) (eq (car-safe fn) 'quote))
(cond
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches