On Tue, Aug 27, 2013 at 7:51 AM, Mike Anderson <mike.r.anderson...@gmail.com
> wrote:

> On 27 August 2013 20:45, Timothy Baldridge <tbaldri...@gmail.com> wrote:
>
>> The reason for not allowing nils isn't a complex one, and basically boils
>> down to the following:
>>
>> a) to avoid race conditions, we need a single value to signal "the
>> channel is closed". As mentioned, nil is the obvious choice for this as it
>> matches lazy seqs and fits well with the rest of clojure:
>>
>>
> Agreed that you want a single sentinel value.
>
> It doesn't match lazy-seqs at all though: lazy seqs can contain nils just
> fine. There's a big difference between (next some-lazy-seq) [which could be
> nil, indicating an empty sequence] and the actual values in the seq [which
> could also be nil but don't indicate the end of the seq].
>

And the when-first macro correctly handles this! It's not just `(when-let
[~x (first ~xs)] ~@body). when-first nicely hides away what would otherwise
be "much more ugly".



-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks, which
may be sweet, aromatic, fermented or spirit-based. ... Family and social
life also offer numerous other occasions to consume drinks for pleasure."
[Larousse, "Drink" entry]

-- 
-- 
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