1.2.0 permalink Arrow_down_16x16
  • (positions pred coll)
Returns a lazy sequence containing the positions at which pred
is true for items in coll.

1 Example top

  • (positions vector? '( 1 2 [ 3 4] 5 [6 7])) 
    (2 4)
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/seq.clj:223 top

(defn positions
  "Returns a lazy sequence containing the positions at which pred
   is true for items in coll."
  [pred coll]
  (for [[idx elt] (indexed coll) :when (pred elt)] idx))
Vars in clojure.contrib.seq/positions: defn for
Used in 0 other vars

Comments top

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