Re: union type syntax

2008-03-22 Thread Peter Hall
When programmers see a type union expression for the first time, and are going to intuitively understand | to be an operator, which has a new meaning when applied to types. Programmers routinely use parens around complex expressions that involve multiple operators, for readability and to ensure

Re: union type syntax

2008-03-21 Thread Waldemar Horwat
There is no solid technical reason for requiring parentheses here. They're here because of people's preferences. I don't find them particularly useful here. Waldemar Peter Hall wrote: Now that union type uses | instead of , for the delimiter, could the parentheses be made optional? It

union type syntax

2008-03-18 Thread Peter Hall
Now that union type uses | instead of , for the delimiter, could the parentheses be made optional? It seems like parentheses are used elsewhere only for grouping and function calls/definitions. UnionType ::= Type ( | UnionType )? which should be easily distinguishable from a bitwise OR

RE: union type syntax

2008-03-18 Thread Lars Hansen
The parens are required. Long discussion here: http://bugs.ecmascript.org/ticket/308 --lars -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Hall Sent: 18. mars 2008 09:58 To: es4-discuss@mozilla.org es4-discuss Subject: union type syntax