1.3.0 permalink 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:2350 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"
   :static true}
  [coll]
   (if (seq? coll) coll
    (or (seq coll) ())))
Vars in clojure.core/sequence:
Used in 0 other vars

Comments top

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