Name

map

Usage

builtin-function

Syntax

(map func &rest seqs)
(map func)

Description

Returns a lazy sequence where the elements of seq are transformed by the function func. The first sequence supplies the first argument of func, the second sequence supplies the second argument of func, etc. The operation stops when one of the sequences runs out. Returns a transducer if no seqs are supplied.

user > (map length (vector "aap" "noot" "mies"))
it: (3 4 4)
user > (map + '(1 2 3) '(4 5))
it: (5 7)
user > (map #(odd? (length %1)) (vector "aap" "noot" "mies"))
it: (true false false)
user > (as-list (eduction (map inc) '(1 2 3)))
it: (2 3 4)