I have a sequence of values. I want to know if any of them value the truth.
(def input [nil nil nil 1 nil 1])
I want to do something like this:
(apply or input)
But I can not, because it or is a macro , not a function. Similarly, it will not work
(reduce or input)
I wrote my own
(def orfn
And now it works
(reduce orfn input)
How this is a little different, although he only checks for nil.
(not (every? nil? input))
What is the “right” way apply oror equivalent?
source
share