News for hackers. Stuff that matters.
Re:Clojure 1.6 released by pi-rat on Tuesday March 25, 2014 @11:36AM (#7466462)
Not sure if I like the 'some?' operation. It's short for (not (nil? x)).. And has nothing to do with 'every?' -which checks if every element of a collection matches a predicate - ex (every? odd? [1 3 5])

To check if some elements match you need to use (some odd? [2 3 4]) - note the lack of '?'

Bet it will confuse people.

Re:Clojure 1.6 released by emiljbs on Tuesday March 25, 2014 @02:12PM (#7467666)
I'd love to hear the reasoning behind that choice if it's Rich Hickey that did it, since it's called some and every in Common Lisp and he's written a great deal in that language.
Re:Clojure 1.6 released by puredanger on Tuesday March 25, 2014 @03:00PM (#7468065)
The names were chosen by Rich. Many choices were considered and they all had pros and cons. The new some?/if-some/when-some functions follow the "not nil" notion in "some->" (but break with the meaning in "some"). Naming is hard. :)
Re:Clojure 1.6 released by dpassen1 on Tuesday March 25, 2014 @01:12PM (#7467153)
Agreed. Seems like a very unnecessary addition.
Re:Clojure 1.6 released by puredanger on Tuesday March 25, 2014 @02:56PM (#7468031)
The non-nil checks are particularly useful in core.async code as nil is a special value for channels (indicating they've been closed). This family of functions can be used to more concisely determine if a value from a channel is a value or means "close".
Re:Clojure 1.6 released by dpassen1 on Tuesday March 25, 2014 @05:45PM (#7469273)
Thanks!