mapcar

(mapcar function list1 ...)

The mapcar function operates on successive elements of the lists list1 ... list_n.

First the function is applied to the car of each list, then to the cadr of each list, and so on.

Note: The elements of the lists are not calculated. A list is returned.

Return Value

mapcar returns a list containing the n results of the successive calls to the function.

Examples

: (mapcar '(lambda (a b) (+ a b) ) '(10 20 30 40) '(1 2 3 4) )

(11 22 33 44)

: (mapcar '* '(1 2 3 4) '(1 2 3 4))

(1 4 9 16)