On Thu, Oct 13, 2016, 12:07 Claude Pache <[email protected]> wrote:

Le 13 oct. 2016 à 17:14, Kagami Rosylight <[email protected]> a écrit :


>IIRC the proposed syntax for computed properties was x?.[y],

Yes you’re right, sorry :/

IMO it still seems the syntax problem is the main reason why this proposal
has stalled. If not, what is the problem here?


The issue with `?.[` is that it is considered as not pretty by some people.
A syntax that is at the same time pretty, technically working, and not
confusing is difficult to find.


I agree with both points here. It's not very pretty, and it's also
inconsistent with the rest of the language. I was just clarifying what I
believed to be the primary contender, independent of bias.


Concerning your suggestion of using `!`: From a technical point of view,
using `![` instead of `?.[` may work only if you forbid a line terminator
before the `!`, because the following program is valid as of today (with
implied semicolons):


```js
foo
![42]
```


I want to like the idea, but many languages (e.g. Swift, Kotlin, and I
think TypeScript 2.0) use it in the inverse direction: non-null assertion
for nullable types. I'm not sure I like the syntax in either form (it has
at least the ability to be non-ambiguous).


I’m curious why this proposal is not even listed in stage 0 proposal list.


Because no representative of TC39 has volunteered to champion it.


—Claude
_______________________________________________
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

Reply via email to