ES4 draft: Map

Erik Arvidsson erik.arvidsson at gmail.com
Tue Mar 11 10:25:06 PDT 2008


I still find this bad UI for people that do not use types, and
remember types are supposed to be optional.  Currently there is no way
to create a map without providing types (not entirely true, see
below).  Neither of the following works as we have speced it today:

var m = new Map;
var m2 = Map();

the closest thing would be to do

var m3 = Map({});

but that is pretty ugly.

What I would like is that the type params are optional and if left out
treated as the any type.  Another simpler option is to make the
argument to meta::invoke to be optional and if left out an empty
Map.<EnumerableId, *> is returned.

2008/3/11 Lars Hansen <lhansen at adobe.com>:
> Draft 3 enclosed.  Changelog near the top; the only significant
>  change is fixing the bug Erik noted in the prototype get
>  and put methods.
>
>  Please note one open issue; the current design is probably OK but
>  I would appreciate comments.
>
>  --lars
>
>
>
>  > -----Original Message-----
>  > From: Lars Hansen
>
>
> > Sent: 3. mars 2008 02:03
>  > To: Lars Hansen; es4-discuss at mozilla.org
>  > Subject: RE: ES4 draft: Map
>  >
>  > Draft 2 enclosed (changelog near the top).
>  >
>  > --lars
>  >
>  > > -----Original Message-----
>  > > From: es4-discuss-bounces at mozilla.org
>  > > [mailto:es4-discuss-bounces at mozilla.org] On Behalf Of Lars Hansen
>  > > Sent: 29. februar 2008 11:34
>  > > To: es4-discuss at mozilla.org
>  > > Subject: ES4 draft: Map
>  > >
>  > > I'm enclosing the draft for the Map class.  Please comment.
>  > >
>  > > --lars
>  > >
>
> _______________________________________________
>  Es4-discuss mailing list
>  Es4-discuss at mozilla.org
>  https://mail.mozilla.org/listinfo/es4-discuss
>
>



-- 
erik



More information about the Es4-discuss mailing list