object literal types
TNO at TheNewObjective.com
Tue Feb 17 16:15:52 PST 2009
Brendan Eich wrote:
> On Feb 17, 2009, at 5:07 AM, Michael Haufe wrote:
>> David-Sarah Hopwood wrote:
>>> "':' (not '=') is used to separate a property name from its value,
>>> so it
>>> can't also be used for type annotations."
> Sharp variables (which I modeled after Common Lisp) are different
> syntax -- their = sign comes *before* the object-type property value
> or outermost object or array initialiser, and the = is preceded by the
> sharp variable name. Also, you can't have any spaces between #n and =
> (for non-negative integer n). There's really no comparison with the
> syntax you sketched.
>> which is what sparked my question.Is there some ambiguity on why this
>> syntax reuse would be off the table?
> Yes, there is an ambiguity. See the grammar:
> PropertyName ':' AssignmentExpression
> PropertyNameAndValueList ',' PropertyName ':' AssignmentExpression
Just the explanation I was looking for, thanks!
More information about the Es-discuss