aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2005-05-23 00:05:40 +0000
committerJuanma Barranquero2005-05-23 00:05:40 +0000
commit868904eb92e91c792ec6d14b7e0d7542f7988175 (patch)
treed4b7214c9ac26f16b2c45eaa6b8ddd0eb1a2fe9b
parent3efc2cd768a4f9838d2a08fde9408b08cec1b0c6 (diff)
downloademacs-868904eb92e91c792ec6d14b7e0d7542f7988175.tar.gz
emacs-868904eb92e91c792ec6d14b7e0d7542f7988175.zip
(acons, pairlis): Add docstring.
-rw-r--r--lisp/emacs-lisp/cl.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index 704d3f8dcd9..e7f736cfd72 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -565,8 +565,17 @@ Return a copy of TREE with all elements `eql' to OLD replaced by NEW.
565 cl-tree (cons a d)))) 565 cl-tree (cons a d))))
566 (t cl-tree))) 566 (t cl-tree)))
567 567
568(defun acons (a b c) (cons (cons a b) c)) 568(defun acons (key value alist)
569(defun pairlis (a b &optional c) (nconc (mapcar* 'cons a b) c)) 569 "Add KEY and VALUE to ALIST.
570Return a new list with (cons KEY VALUE) as car and ALIST as cdr."
571 (cons (cons key value) alist))
572
573(defun pairlis (keys values &optional alist)
574 "Make an alist from KEYS and VALUES.
575Return a new alist composed by associating KEYS to corresponding VALUES;
576the process stops as soon as KEYS or VALUES run out.
577If ALIST is non-nil, the new pairs are prepended to it."
578 (nconc (mapcar* 'cons keys values) alist))
570 579
571 580
572;;; Miscellaneous. 581;;; Miscellaneous.