Clojure’s concat creates a lazy sequence containing the elements of zero or more sequential collections in succession. With no arguments it returns (); with one argument it accepts a sequential value or nil. section 9.3.9
Use concat with these practical expectations:
- Inputs may be sequential collections or nil; a non-sequential input raises IllegalArgumentException. section 9.3.9
- Consumption is lazy: concat realizes only enough input to satisfy the consumer. section 9.3.9
Concatenating changing sources
(def sold-icecreams [[:strawberry :banana :vanilla] '(:vanilla :chocolate) #{:hazelnut :pistachio}]) (apply concat sold-icecreams) ;; (:strawberry :banana :vanilla :vanilla :chocolate :hazelnut :pistachio)









