((floatp sexp) (float-to-string sexp))
((characterp sexp) (code "\"" (escape-string (string sexp)) "\""))
(t
- (or (cdr (assoc sexp *literal-table* :test #'equal))
+ (or (cdr (assoc sexp *literal-table* :test #'eql))
(let ((dumped (typecase sexp
(symbol (dump-symbol sexp))
(string (dump-string sexp))
(rplaca tail (cdar tail)))
(collect (apply func elems))))))))
+(defun mapc (func &rest lists)
+ (do* ((elems (map1 #'car lists) (map1 #'car lists-rest))
+ (lists-rest (map1 #'cdr lists) (map1 #'cdr lists-rest)))
+ ((dolist (x elems) (when (null x) (return t)))
+ (car lists))
+ (apply func elems)))
+
(defun last (x)
(while (consp (cdr x))
(setq x (cdr x)))
get-universal-time go identity if in-package incf integerp intern
intersection keywordp labels lambda last length let let*
lisp-implementation-type list list* list-all-packages listp loop
- make-array make-package make-symbol mapcar member minusp mod
+ make-array make-package make-symbol mapc 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 pairlis
(bar (pop foo)))
(and (= bar 1)
(= (car foo) 2))))
+
+;; MAPC
+(test (equal (mapc #'+ '(1 2) '(3) '(4 5 6)) '(1 2)))
+(test (let (foo)
+ (mapc (lambda (x y z) (print (list x y z)) (push (+ x y z) foo)) '(1 2) '(3) '(4 5 6))
+ (equal foo '(8))))