Re: ES4 draft: array initializer expressions

2008-06-22 Thread Olav Kjær
I have a (perhaps stupid) question regarding the Array type syntax. What is the use case for a type like: [string, double, ...boolean] I understand the utility of heterogeneous tuples of a fixed size, and of homogeneous lists of variable size, but I don't really see when I would use a hybrid like

Re: ES4 draft: array initializer expressions

2008-04-16 Thread Jeff Dyer
'var' and 'const' need to be added to the lookahead set on ExpressionStatement. That will take care of the ambiguity. Jd On 4/15/08 5:08 PM, Waldemar Horwat wrote: > My comments: > > > The grammar is ambiguous. > > var [x, y] = expr; > > is both an assignment expression statement and a dest

Re: ES4 draft: array initializer expressions

2008-04-15 Thread Waldemar Horwat
My comments: The grammar is ambiguous. var [x, y] = expr; is both an assignment expression statement and a destructuring variable binding statement. How does the "length" property work for structural type literals? Is it always a fixture? > If the array initializer is prefixed by |const|

ES4 draft: array initializer expressions

2008-04-08 Thread Lars Hansen
Enclosed is the first draft of the description of array initializer syntax, which has evolved quite a bit in ES4. The draft feels a little raw, maybe because we have yet to pin down all aspects of how structural array types interact with everything; please read critically and ask difficult questio