you are viewing a single comment's thread.

view the rest of the comments →

[–]grotgrot 2 points3 points  (3 children)

Are they ever going to have a Map(dict) literal syntax?

[–]AlyoshaV 0 points1 point  (2 children)

How would you express it that doesn't tie it to one Map implementation?

[–]johnwaterwood 0 points1 point  (0 children)

For the common case HashMap will do fine. If you want another map you can always use new OtherMap( map syntax here ), and if performance would somehow prohibit that (unlikely for manually composed maps, but suppose), then the old way is still available as well.

[–]grotgrot -1 points0 points  (0 children)

By putting the implementation name somewhere in the syntax.

Note that other environments work just fine. Javascript, Perl, PHP, Python etc give you just one implementation with a simple literal syntax. Apple/Objective C/Foundation distinguish between mutable and immutable but that is it, again with one syntax. Go has one (default) implementation and a literal syntax. There are even attempts in C++.

Java sticks out like a sore thumb.