On Sat, Nov 2, 2013 at 6:07 AM, Alex Miller <a...@puredanger.com> wrote:
> > One other point: > > Sometimes people use sorted maps and array maps specifically for > scenarios in which the keys are not hashable and therefore hash maps would > not apply. Dumping the contents into a regular map in such cases doesn't > make much sense. > > Everything is hashable, not sure what a non-hashable key means. Array maps > use the hash of the key to determine the array bucket. If you get the hash > code of a sorted map, it will get the hash of all keys and values. > Infinite sequences are not hashable. They can be sorted lexicographically, provided you know in advance you're not working with two equal sequences. I believe that array maps just store items in the order you put them in, never computing the hash. Not sure that using infinite sequences as keys is a common use case, but when I wrote that, I was thinking that might be representative of a larger set of examples where it is impossible or impractical to compute the hashes of your keys. -- -- 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.