[Prototype-core] True Hashes using objects as keys

2009-09-11 Thread Samuel Lebeau
Hi, I think it's indeed a good feature to discuss for 2.0. I've been working on this too and had quite reasonable performance when using a hash function that avoids collision. The simplest implementation consists in storing array of [key, value] tuples indexed by `key.toString()` in a

[Prototype-core] True Hashes using objects as keys

2009-09-10 Thread James Aimonetti
Core, Wanted to ask about why Hash doesn't support Objects as keys? I believe it relies on Javascript using the toString on the object to set the key's value, rather than a true hash. var key1 = new Object(); var key2 = new Object(); var h = $H(); h.set(key1, First); h.set(key2, Second);