concept filter in category clojure

appears as: filter, filter, filters
Clojure: The Essential Reference

This is an excerpt from Manning's book Clojure: The Essential Reference.

  • nil? is a better option to use as a predicate with filter to deal with nil elements in the sequence. As we have seen in the examples, identity use with filter also removes false elements, while nil? does not:

    (remove nil? [0 1 2 false 3 4 nil 5])
    ;; (0 1 2 false 3 4 5)
  • nil? is a better option to use as a predicate with filter to deal with nil elements in the sequence. As we have seen in the examples, identity use with filter also removes false elements, while nil? does not:

  • nil? is a better option to use as a predicate with filter to deal with nil elements in the sequence. As we have seen in the examples, identity use with filter also removes false elements, while nil? does not:

    (remove nil? [0 1 2 false 3 4 nil 5])
    ;; (0 1 2 false 3 4 5)
  • Reducers were introduced in Clojure 1.5. Reducers implementation can be found in the clojure.core.reducers namespace (which needs to be required before use). Reducers contain a wrapper layer on top of the Java fork-join framework (a model for parallelism introduced in Java 1.7). Reducers also contain a set of collection processing functions that have the same name as the ones in core: map, filter, reduce to name a few. Compared to the ones in clojure.core, they create a deferred "recipe" for processing that is executed when calling reduce: