diff lisp/cl-extra.el @ 5057:742b7a124d6c

Automated merge with file:///home/aidan/xemacs-21.5-checked-out
author Aidan Kehoe <kehoea@parhasard.net>
date Mon, 22 Feb 2010 20:09:23 +0000
parents 6aba0daedb7c
children 868a9ffcc37b
line wrap: on
line diff
--- a/lisp/cl-extra.el	Sun Feb 21 23:20:44 2010 -0500
+++ b/lisp/cl-extra.el	Mon Feb 22 20:09:23 2010 +0000
@@ -612,6 +612,17 @@
 	  ((memq (car plst) indicator-list)
 	   (return (values (car plst) (cadr plst) plst))))))
 
+;; See our compiler macro in cl-macs.el, we will only pass back the
+;; actual lambda list in interpreted code or if we've been funcalled
+;; (from #'apply or #'mapcar or whatever).
+(defun constantly (value &rest more-values)
+  "Construct a function always returning VALUE, and possibly MORE-VALUES.
+
+The constructed function accepts any number of arguments, and ignores them.
+
+Members of MORE-VALUES, if provided, will be passed as multiple values; see
+`multiple-value-bind' and `multiple-value-setq'."
+  `(lambda (&rest ignore) (values-list ',(cons value more-values))))
 
 ;;; Hash tables.