Hello,

On Thu, Oct 29, 2009 at 3:35 AM, Alex Osborne <a...@meshy.org> wrote:
>
> John Harrop wrote:
>> Probably the seq .hashCode should consider only the first N elements
>> for some maximum N and if two longer (or even infinite) sequences
>> collide so be it.
>
> I strongly disagree.  Choosing some arbitrary magic cutoff point just
> seems cause for trouble and much confusion.  Putting something in a hash
> set or using it as a map key implies evaluating it -- you'd expect
> summing or printing an infinite sequence to hang, so why shouldn't
> hashing it also hang?

+1, I also disagree. If there is a need to compare parts of infinite
sequences, just truncate them and compare the resulting finite parts.
This is something that belongs in the application, not in the
language, as the value for N depends on the application and there is
no N that fits everyone (other than infinity).

-- 
Miron Brezuleanu

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

Reply via email to