Andreas Rossberg wrote:
(OTOH, I'd prefer finding a way to do guards with single ':'... :-) )

I started there too (ES4, ML which was used [SML] for the ES4 reference implementation, other work such as Links). But TC39 argued about it and the desire to guard property names in object literals led us to favor ::.

let guardedObj = {p1::t1: v1, ~~~ pN::tN: vN};

Using : is ambiguous (using :, a property assignment, assuming optional guards, could have p:t or p:v or p:t:v). I suggested requiring parenthesization:

let guardedObj = {(p1:t1): v1 ~~~ (pN:tN): vN};

but no one liked that! Since :: was only twice as bad as :, and Haskell used it, we agreed to :: for guards.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to