To partially answer:
You can use '__proto__' because a dict is basically Object.create(null),
which in ES6 means __proto__ will be just another property. The dict module
also exports entries, keys, and values, so the iteration protocol for a
dict requires using one of those. An example of using dict:
import { dict, entries } from '@dict';
const myDict = dict({ a: 10, b: 20, c: 30 });
for (let [key, value] of entries(myDict)){
console.log(key, value);
}
On Tue, Jan 8, 2013 at 3:13 PM, Axel Rauschmayer <[email protected]> wrote:
> Playing devil’s advocate: Is Dict really necessary? Whenever performance
> doesn’t matter (as much), I’d advocate Map. Otherwise, I’d expect
> programmers who want the extra speed to be comfortable with
> Object.create(null).
>
> Assumptions about Dict:
> - You still can’t use the key '__proto__'.
> - You can’t invoke any methods on it.
>
> How will it implement the iteration protocol?
>
> --
> Dr. Axel Rauschmayer
> [email protected]
>
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss