You're viewing version 1.2.0 of sequence. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

sequence

clojure.core

  • (sequence coll)
Coerces coll to a (possibly empty) sequence, if it is not already
one. Will not force a lazy seq. (sequence nil) yields ()

1 Example top

  • user> (sequence [1 2 3])
    (1 2 3)
    user> 
    (1 2 3)
    user> (class (sequence '(1 2 3)))
    clojure.lang.PersistentList
Log in to add / edit an example.

See Also top

  • 0
    clojure.core/seq

    Returns a seq on the collection. If the collection is empty, retu

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:2018 top

(defn sequence
  "Coerces coll to a (possibly empty) sequence, if it is not already
  one. Will not force a lazy seq. (sequence nil) yields ()"
  {:added "1.0"}
  [coll]
   (if (seq? coll) coll
    (or (seq coll) ())))
Vars in clojure.core/sequence: defn or seq seq?
Used in 1 other vars str-join

Comments top

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