Clojure - Predicates not-any?



Returns false if any of the predicates of the values in a collection are logically true, else true.

Syntax

Following is the syntax.

(not-any? p1 col)

Parameters − ‘p1’is the predicate which needs to be tested. ‘col’ is the collection of values which needs to be tested.

Return Value − Returns false if any of the predicates of the values in a collection are logically true, else true.

Example

Following is an example of not-any? in Clojure.

(ns clojure.examples.example
   (:gen-class))
(defn Example []
   (println (not-any? even? '(2 4 6))))
(Example)

Output

The above program produces the following output.

false
clojure_predicates.htm
Advertisements