1.2.0 permalink Arrow_down_16x16
  • (separate f s)
Returns a vector:
[ (filter f s), (filter (complement f) s) ]

1 Example top

  • ; In your project.clj, you need to declare dependencies like so:
    :dependencies [   [org.clojure/clojure            "1.6.0"]
                      [org.clojure/clojure-contrib    "1.2.0"] ]
    
    ; Then, require the library as normal in your source code:
    (ns demo.core
      (:require [clojure.contrib.seq :as seq] ))
    
    ; Then, use the function in your code:
    (prn (seq/separate odd? (range 5)))
    ;=>> [(1 3) (0 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:45 top

(defn separate
  "Returns a vector:
   [ (filter f s), (filter (complement f) s) ]"
  [f s]
  [(filter f s) (filter (complement f) s)])
Vars in clojure.contrib.seq/separate: defn
Used in 0 other vars

Comments top

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