On Feb 4, 7:21 am, MikeM <michael.messini...@invista.com> wrote:
> > Other than that, there is just the general loss of nil-punning. This
> > was the theoretical problem that kept me from making this tradeoff
> > earlier. I'm very much interesting in hearing from those for whom the
> > lazy branch represents a real problem due to loss of nil punning.
>
> To preserve nil-punning, could the 'if' special form be changed to
> internally perform the equivalent of the seq call when presented with
> a sequence? Since more is guaranteed to never return nil, in the
> context of an 'if', a seq call would always be appropriate. I suppose
> there's a performance hit for checking whether the argument is a
> Sequence before calling seq on it, but instanceof is supposed to be
> very fast with hotspot.

I don't think a fundamental primitive like 'if' could be burdened with
such a check. Also, most collections can be supplied when their seq is
required, but what would this return?

(if [] true false)

I'd hate to lose the ability to distinguish between an empty
collection and nothing.

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

Reply via email to