On 27/10/2007, James Clark <[EMAIL PROTECTED]> wrote: > (int, string) doesn't seem to me to be a syntax that the average JS > programmer will guess means union. I would have thought a better choice > would be (int | string) (especially given that regexps use |) or a keyword.
Honestly, there's very little in the type system that I think will come entirely natural for ES3 users. Annoted object types look like object initialisers with name-value pairs, annoted array types look like array initialisers, the constructor syntax looks entirely weird, parametric types don't look like anything else in the language etc. And other parts too - destructuring assignment, array comprehensions etc, all look slightly foreign. I really don't think this syntax is that very foreign (it's a quite natural way to list different types something can be after all), and with all the new syntax related to typing, as well as other syntax additions, it's going to be one tiny part of an entire new domain to learn. -- David "liorean" Andersson _______________________________________________ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss