next up previous
Next: 9.5 remove-ifなど Up: 9 シーケンスデータ Previous: 9.3 concatenate


9.4 map

以前出てきたmapcarなどに似た形でシーケンスに対応している ものとしてmapがあります.
<cl> (mapcar #'1+ '(1 2 3))
(2 3 4) 
<cl> (mapcar #'1+ '#(1 2 3))
Error: Attempt to take the car of #(1 2 3) which
     is not a cons.
[1] <cl> :reset
<cl> (map 'list #'1+ '#(1 2 3))
(2 3 4) 
<cl> (map 'vector #'1+ '#(1 2 3))
#(2 3 4) 
<cl>


generated through LaTeX2HTML. M.Inaba 平成18年5月7日