How can I apply 'or' in Clojure?

Viewed 163

I have a sequence of values. I want to know if any of them evaluates true.

(def input [nil nil nil 1 nil 1])

I want to do something like this:

(apply or input)

But I can't because or is a macro not a function. Similarly this won't work

(reduce or input)

I've written my own

(def orfn #(if %1 %1 %2))

And now this works

(reduce orfn input)

As does this slightly different approach, although it only tests for nil.

(not (every? nil? input))

What's the 'right' way to apply or or equivalent?

2 Answers
Related