5) New "some" operations
Many conditional functions rely on logical truth (where "falsey"
values are nil or false). Sometimes it is useful to have functions
that rely on "not nilness" instead. These functions have been added to
support these cases [CLJ-1343]:
* some? - same as (not (nil? x))
* if-some - like if-let, but checks (not (nil? test)) instead of test
* when-some - like when-let, but checks (not (nil? test)) instead of test
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Looking forward to this ... any ideas on submitted issues w/ valid patches that are in limbo? (*)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Great changes! I have a question about #5.5) New "some" operations
Many conditional functions rely on logical truth (where "falsey"
values are nil or false). Sometimes it is useful to have functions
that rely on "not nilness" instead. These functions have been added to
support these cases [CLJ-1343]:
* some? - same as (not (nil? x))
* if-some - like if-let, but checks (not (nil? test)) instead of test
* when-some - like when-let, but checks (not (nil? test)) instead of testIt seems inconsistent to have "some" mean two very different things within the same namespace, especially since the prior uses of "some" (`some`, `some-fn`, etc.) are more in keeping with its primary definition of having to do with amount (and operate on seqs or variadic arguments) while the new functions have to do with existence (and operate on any single value). Why not call these new functions `not-nil?`, `if-not-nil`, and `when-not-nil`? Or, if "not-nil" is too unwieldy then what about "exists" (`exists?`, `if-exists`, `when-exists`)?Are these names up for discussion?
Could someone clarify for me why "some?" as a name for not nil makes sense at all in the first place? Not criticizing. I just don't understand what existence or there being some of something has to do with nil.
On February 15, 2014 at 1:02:43 PM, Alex Miller (al...@puredanger.com) wrote:
truthy? = identity
falsey? = not
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/tseJgAi3HC4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
On February 15, 2014 at 1:02:43 PM, Alex Miller (al...@puredanger.com) wrote:
truthy? = identity
falsey? = not
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/tseJgAi3HC4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
- nil Means 'nothing/no-value'- represents Java null and tests logical false [clojure.org/reader]
--