result-type | sequence type specifier or NIL |
fn | function that takes as many arguments as there are sequences |
seqs | sequences which elements are processed in parallel |
MAP applies function FN to elements of sequence with same index. Each application result is put into resulting sequence. Length of resulting sequence is the length of the shortest sequence in argument. Return value is NIL when NIL was specified as result-type. See also MAPC, MAPCAR and MAPCAN.
(map 'list (lambda (x) (+ x 10)) '(1 2 3 4)) => (11 12 13 14)
(map 'vector #'identity "hola") => #(#\h #\o #\l #\a) (map '(vector character) #'identity #(#\h #\o #\l #\a)) => "hola" (map 'string #'identity '(#\h #\o #\l #\a)) => "hola"
(map 'vector #'list '(123 symbol "string" 345) '(1 2 3)) => #((123 1) (SYMBOL 2) ("string" 3))
(map 'list #'* '(3 4 5) '(4 5 6)) => (12 20 30) (map 'nil #'* '(3 4 5) '(4 5 6)) => NIL