Welcome! Please see the About page for a little more info on how this works.

+2 votes
in Clojure by

Some arities of some-fn return false on no-match, others return nil. I propose the return value should always be nil like some--which some-fn is an unrolling of.

user=> ((some-fn identity identity identity) false)
false
user=> ((some-fn identity identity identity identity) false)
nil

Logged as: https://clojure.atlassian.net/browse/CLJ-2634

2 Answers

0 votes
by
selected by
 
Best answer

The function is not a predicate (does not end in ?), and quite clearly talks about "logical true" and "logical false" in the docstring. So, will not fix.

0 votes
by

Isn't this a duplicate of https://ask.clojure.org/index.php/10366/some-has-different-short-circuiting-when-using-predicates which has been fixed in Clojure 1.11 Alpha 2?

by
No, I don't think so.

   $ clj -Sdeps \
       '{:deps
         {org.clojure/clojure
          {:mvn/version "1.11.0-alpha2"}}}'
   Clojure 1.11.0-alpha2
   user=> *clojure-version*
   {:major 1, :minor 11, :incremental 0, :qualifier "alpha2"}
   user=> ((some-fn identity identity identity) false)
   false
   user=> ((some-fn identity identity identity identity) false)
   nil
...