changeset 62642:59b6666e38f9

(acons, pairlis): Add docstring.
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 23 May 2005 00:05:40 +0000
parents 27b53b1903b6
children 253d903435d5
files lisp/emacs-lisp/cl.el
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/cl.el	Mon May 23 00:03:59 2005 +0000
+++ b/lisp/emacs-lisp/cl.el	Mon May 23 00:05:40 2005 +0000
@@ -565,8 +565,17 @@
 	       cl-tree (cons a d))))
 	(t cl-tree)))
 
-(defun acons (a b c) (cons (cons a b) c))
-(defun pairlis (a b &optional c) (nconc (mapcar* 'cons a b) c))
+(defun acons (key value alist)
+  "Add KEY and VALUE to ALIST.
+Return a new list with (cons KEY VALUE) as car and ALIST as cdr."
+  (cons (cons key value) alist))
+
+(defun pairlis (keys values &optional alist)
+  "Make an alist from KEYS and VALUES.
+Return a new alist composed by associating KEYS to corresponding VALUES;
+the process stops as soon as KEYS or VALUES run out.
+If ALIST is non-nil, the new pairs are prepended to it."
+  (nconc (mapcar* 'cons keys values) alist))
 
 
 ;;; Miscellaneous.