Applying a Function to Successive Elements of a List (the MAPCAR way)
; Here’s a simpler way:
> (mapcar #'1+ '(1 2 3 4 99.9))
(2 3 4 5 100.9)
; OK for functions that take multiple args:
> (mapcar #'cons '(a b c) '(1 2 3))
((A . 1) (B . 2) (C . 3))
Previous slide
Next slide
Back to first slide
View graphic version