What does Scala do? I mean, given that it doesn't have the same problem, perhaps it has a solution?
Andy Fingerhut <andy.finger...@gmail.com> writes: > If you can think of a different hash function for vectors that doesn't lead > to these types of collisions, I'm all ears. The issue is that the hash > function for sets adds up the hash values of its elements. Those sums of > vector hash values are what are colliding, not the individual vector hash > values themselves. > > Andy > > > On Wed, Oct 23, 2013 at 10:28 AM, Paul Butcher <p...@paulbutcher.com> wrote: > >> On 23 Oct 2013, at 18:15, Andy Fingerhut <andy.finger...@gmail.com> wrote: >> >> If we had a 'universal comparator', i.e. a comparison function that >> provided a total order on any pair of values that anyone would ever want to >> put into a set or use as a map key, then instead of having linked lists for >> values that collide, we could have trees like those in the implementations >> of sorted-maps and sorted-sets today. >> >> >> Wouldn't it be better to improve the way that hashes are calculated for >> vectors? A good hash function should make it unlikely that similar values >> have the same hash. The current algorithm seems to make that more likely >> than it should? >> >> -- >> paul.butcher->msgCount++ >> >> Snetterton, Castle Combe, Cadwell Park... >> Who says I have a one track mind? >> >> http://www.paulbutcher.com/ >> LinkedIn: http://www.linkedin.com/in/paulbutcher >> MSN: p...@paulbutcher.com >> AIM: paulrabutcher >> Skype: paulrabutcher >> >> -- >> -- >> 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. >> > > -- -- Phillip Lord, Phone: +44 (0) 191 222 7827 Lecturer in Bioinformatics, Email: phillip.l...@newcastle.ac.uk School of Computing Science, http://homepages.cs.ncl.ac.uk/phillip.lord Room 914 Claremont Tower, skype: russet_apples Newcastle University, twitter: phillord NE1 7RU -- -- 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.