(defun acons (key datum alist)
(cons (cons key datum) alist))
+(defun pairlis (keys data &optional (alist ()))
+ (while keys
+ (setq alist (acons (car keys) (car data) alist))
+ (setq keys (cdr keys))
+ (setq data (cdr data)))
+ alist)
+
(define-setf-expander car (x)
(let ((cons (gensym))
make-symbol mapcar member minusp mod multiple-value-bind
multiple-value-call multiple-value-list multiple-value-prog1
nconc nil ninth not nreconc nth nthcdr null numberp or otherwise
- package-name package-use-list packagep parse-integer plusp pop
- prin1-to-string print proclaim prog1 prog2 progn psetq push
+ package-name package-use-list packagep pairlis parse-integer plusp
+ pop prin1-to-string print proclaim prog1 prog2 progn psetq push
quote read-from-string remove remove-if remove-if-not return
return-from revappend reverse rplaca rplacd second set setf seventh
setq sixth some string string-upcase string= stringp subseq subst
(acons 1 2 (list (cons 3 4)))))
(test (equal (list (cons 1 2)) (acons 1 2 ())))
+; PAIRLIS
+(test (equal (list (cons 1 3) (cons 0 2))
+ (pairlis '(0 1) '(2 3))))
+(test (equal (list (cons 1 2) (cons 'a 'b))
+ (pairlis '(1) '(2) (list (cons 'a 'b)))))
+
; SUBST
; Can't really test this until EQUAL works properly on lists