• (cons x seq)
Returns a new seq where x is the first element and seq is
the rest.

1 Example top

  • user=> (cons 1 '(2 3 4 5 6))
    (1 2 3 4 5 6)
    
    user=> (cons [1 2] [4 5 6])
    ([1 2] 4 5 6)
Log in to add / edit an example.

See Also top

  • 0
    clojure.core/conj

    conj[oin]. Returns a new collection with the xs 'added'. (conj ni

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:22 top

(def
 ^{:arglists '([x seq])
    :doc "Returns a new seq where x is the first element and seq is
    the rest."
   :added "1.0"
   :static true}

 cons (fn* ^:static cons [x seq] (. clojure.lang.RT (cons x seq))))
Vars in clojure.core/cons:
Used in 0 other vars

Comments top

No comments for cons. Log in to add a comment.