Name

mapcat

Usage

function

Syntax

(mapcat func &rest seqs)
(mapcat func)

Description

Applies func to seqs as in map and concatenates the return values which must be sequences. Returns a transducer if no seqs are supplied.

user 1 > (map #(list %1 %1) (series 5))
it: ((1 1) (2 2) (3 3) (4 4) (5 5))
user 2 > (mapcat  #(list %1 %1) (series 5))
it: (1 1 2 2 3 3 4 4 5 5)
user 3 > (as-list (eduction (map #(list %1 %1)) (series 5)))
it: ((1 1) (2 2) (3 3) (4 4) (5 5))