Like this, just

not-nil?
if-not-nil
when-not-nil

is much better for me.



суббота, 15 февраля 2014 г., 7:12:21 UTC+4 пользователь Joel Holdbrooks 
написал:
>
> As an addendum to my last comment, *not-nil?* would also be a good 
> candidate. That really doesn't leave room for doubt.
>
> This:
>   
> (some? false) ;; => true 
>
> Would confuse me. On the other hand this:
>   
> (not-nil? false) ;; => true 
>
> Would not.
>
> There's really no need to complicate the naming story here. It's also easy 
> to remember!
>
> On Friday, February 14, 2014 3:25:36 PM UTC-8, Alex Miller wrote:
>>
>>
>>
>> On Friday, February 14, 2014 2:27:49 PM UTC-6, DomKM wrote:
>>>
>>> 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 
>>>> test
>>>
>>>
>>> It 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?
>>>
>>
>> Hey Dom et al,
>>
>> The names of these functions were chosen by Rich. There was already some 
>> name overloading of "some" even before these new functions with some 
>> (truthy) and some->/some->> (not nil). The new functions keep with the 
>> latter meaning. Many other names were considered, including everything I've 
>> seen someone mention (-not-nil, exists, nnil, etc). As far as I know these 
>> names are final, however, I will relay all of the feedback I've seen here, 
>> on #clojure, and on Twitter to Rich for consideration.
>>
>> Alex
>>  
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to