On Thu, Oct 13, 2016, 12:07 Claude Pache <claude.pa...@gmail.com> wrote:

Le 13 oct. 2016 à 17:14, Kagami Rosylight <sascha...@outlook.com> 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):


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.

es-discuss mailing list
es-discuss mailing list

Reply via email to