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

select

clojure.set

  • (select pred xset)
Returns a set of the elements for which pred is true

1 Example top

  • user=> (select odd? #{1 2 3} )
    #{1 3}
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/set.clj:64 top

(defn select
  "Returns a set of the elements for which pred is true"
  {:added "1.0"}
  [pred xset]
    (reduce (fn [s k] (if (pred k) s (disj s k)))
            xset xset))
Vars in clojure.set/select: defn disj fn reduce
Used in 0 other vars

Comments top

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