Skip to content

clojure.core/cons

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 5 Runnable: 4
([x seq])

Returns a new seq where x is the first element and seq is the rest.

Examples

by dpritchett on
by phalphalak on
by edcaceres on
by belun on . May have evaluation errors.
by didiercrunch on

Note by belun

useful for creating lazy sequences, because it does not need to realize the param "seq" (it just appends the whole thing to param "x"

http://stackoverflow.com/questions/12389303/clojure-cons-vs-conj-with-lazy-seq

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.