Re: Value Types as map keys in ES7

2014-04-06 Thread K. Gadd
I guess the analog for this in traditional JS 'Object' instances is that when you use the [] operator, i.e. obj[valueObject], it actually does obj[valueObject.toString()], so you can control the 'hashing function' in a sense by overriding toString. It seems natural to want something equivalent

Re: Value Types as map keys in ES7

2014-04-06 Thread Rick Waldron
On Sunday, April 6, 2014, K. Gadd k...@luminance.org wrote: I guess the analog for this in traditional JS 'Object' instances is that when you use the [] operator, i.e. obj[valueObject], it actually does obj[valueObject.toString()], so you can control the 'hashing function' in a sense by

Re: Value Types as map keys in ES7

2014-04-06 Thread Allen Wirfs-Brock
An there is nothing stopping someone from defining their own map class (possibly by subclassing Map) that has its own hashing and comparison policies. JS implementations + ES6 functionality are good enough that we don't have to wait for such things to be built-in. Allen On Apr 6, 2014, at

Value Types as map keys in ES7

2014-04-05 Thread Benjamin (Inglor) Gruenbaum
I'd like to raise an issue with ES7 value objects with maps raised here: http://esdiscuss.org/topic/maps-with-object-keys To save you all time, let me sum things up: ES6 maps don't solve a particular (but common) issue for me - using compound objects as keys. I do a lot of statistical analysis