Axel Rauschmayer (2014-10-02T03:47:55.000Z)
> We could definitely have Map and Set literals:
> 
> const map = {1 => "one", "two" => true, false => "three"};

Would that be tricky to parse if keys can be arbitrary expressions (incl. array literals)?

> const set = {<1, "two", false>};
> 
> If you still buy Harmony of My Dreams, prefix # before { to get immutable value-type forms.
> 
> I don't mind reusing => in initialiser context where : would go, but perhaps someone sees a problem I don't.

Using something other than a colon seems a good idea, to make it clear that any kind of value can be used as keys.

Another possibility:

```js
const map = {: 1 => "one", "two" => true, false => "three" :};
const set = {. 1, "two", false .};
```

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141002/3fc83438/attachment.html>
forbes at lindesay.co.uk (2016-02-01T12:18:43.851Z)
> ```js
> const map = {1 => "one", "two" => true, false => "three"};
> ```

Would that be tricky to parse if keys can be arbitrary expressions (incl. array literals)?

> I don't mind reusing `=>` in initialiser context where `:` would go, but perhaps someone sees a problem I don't.

Using something other than a colon seems a good idea, to make it clear that any kind of value can be used as keys.

Another possibility:

```js
const map = {: 1 => "one", "two" => true, false => "three" :};

const set = {. 1, "two", false .};
```