tags:

views:

140

answers:

1

I cannot use logical functions on a range of booleans in Clojure (1.2). Neither of the following works due to logical functions being macros:

(reduce and [... sequence of bools ...])
(apply or [... sequence of bools ...])

The error message says that I "can't take value of a macro: #'clojure.core/and". How to apply these logical functions (macros) without writing boilerplate code?

+7  A: 

Don't -- use every? and some instead.

Michał Marczyk
Exactly what I was looking for.
Alex B