and it's not hard to guess, and then prove, why:

user=> (defn fibs [] (map first (iterate (fn [[a b]] [b (+ a b)]) [1 1])))
#'user/fibs
user=> (take 10 (fibs))
(1 1 2 3 5 8 13 21 34 55)
user=> (.hashCode 12)
12
user=> (.hashCode "foo")
101574
user=> (.hashCode (take 10 (fibs)))
-1796812414
user=> (.hashCode (fibs))
<hangs>

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.

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