On Feb 17, 10:52 pm, Mark Engelberg <[email protected]> wrote:
> Since there is no canonical empty sequence, this makes me wonder
> whether one particular empty sequence might have some kind of
> performance benefit over another.
>
> For example, if I were going to give a name to one empty sequence to
> reuse within my code, would one of these be preferable?:
> (def empty '())
> (def empty (sequence []))
> or some other variation?
There cannot be a canonical empty sequence since lazy-seqs don't know
if they are empty until forced.
This should suffice, and seems better than any parochial name like
empty (which is also names a core function BTW):
()
I recommend people not use '() in Clojure, it's ugly and unnecessary.
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---