Simplified Common Lisp reference
map-into
Symbol class: Sequences (Lists, Strings) and Arrays
Syntax:
Symbol type: function
map-intoresult-sequencefnseqs(one or more) => result-sequence
Argument description:
result-sequence 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-INTO applies function fn to elements of sequence with same index. Each application result is destructively put into resulting sequence. The iteration terminates when the shortest sequence (of any of the sequences or the result-sequence) is exhausted. Return value is same as the first argument. See also MAP, MAPCAR and MAPCAN.

(let ((a (list 1 2 3 4))) (map-into a #'* a a) a) => (1 4 9 16)
(let ((a (vector 1 2 3 4))) (map-into a #'* a a) a) => #(1 4 9 16)
(let ((a (vector 1 2 3 4))) (map-into a #'1+ '(1 2)) a) => #(2 3 3 4)
Function indexFull documentation for map-into (HyperSpec)