'function *' is not mandatory
jussi.kalliokoski at gmail.com
Mon Sep 2 02:19:11 PDT 2013
On Mon, Sep 2, 2013 at 10:49 AM, Brendan Eich <brendan at mozilla.com> wrote:
> Jussi Kalliokoski wrote:
>> Is the star after yield any less arbitrary?
> Not much -- it conjures Kleene's star, worth something (not much? enough!).
Fair enough, I suppose Kleene's star with its "zero or more" semantics
comes close enough, but in that case, shouldn't the star be a suffix to the
value rather than a prefix (like we already have with RegExp)? ;)
> Your comments on the grammar show continued informality and lack
>> of familiarity with parsing theory in general, and the ECMA-262
>> grammar formalisms in particular.
>> They probably do since I am not familiar with parsing theory in general,
>> but I probably represent a large portion of the community with that
>> disability (which I hope to repair at some point). I wouldn't ask the
>> questions if I knew the answers, now would I. To me this seems just like
>> arbitrary limitations where it's somehow impossible to add an if statement
>> in the parser.
> We don't want to mess around with ambiguity. The smell of a suffix
> character for function is strictly less than the smell of a sub-grammar for
> 'generator' distinct from other identifiers, with newline sensitivity.
All right, although in my head it's better for the parser to have to bear
the bad smell than people writing and reading the code. But it seems the
general course with ES currently is to keep the smell at the end
programmers' end rather than the parser's end and let compile-to-JS fix the
resulting smell in the end programmers' end. :)
>> We don't want to split 'generator' out from Identifier, and
>> special-case its syntax in PrimaryExpressions (which must be
>> covered by a cover-grammar that also covers destructuring). We
>> don't have a convenient formalism for such special-casing.
>> All right, so it would be a much larger effort to specify it?
> The work involves splitting Identifier :: IdentifierName but not
> ReservedWord into 'generator' | IdentifierNotGenerator and adding
> IdentifierNotGenerator :: IdentifierName but not ('generator' or
> ReservedWord), then splitting Identifier uses and coping with the cover
> grammar complexity. I haven't done the work to make sure it's sound. Much
> bigger fish to fry, rotten smell already.
Fair enough. If the result value < effort value, there's not much to do.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss