Allen's lambda syntax proposal

Yuh-Ruey Chen maian330 at gmail.com
Wed Dec 17 18:53:37 PST 2008


Lex Spoon wrote:
> On this list, the => form has so far been dismissed due to parsing
> concerns.  If that's the only reason, let me try and allay that worry
> and put that horse back in the race.  Scala also has a comma operator,
> but it still manages to parse the => syntax.  They way it does it is
> to initially parse an expression and then, if it sees a =>,
> reinterpret what it has seen so far as a parameter list.  It's an
> unusual parsing strategy, but it works well and the issue is
> localized.
>   

I don't think anyone is suggesting that it would be too difficult to
parse for bottom-up parsers. It's just that it makes it difficult for a
certain common class of bottom-up parsers, namely the LALR(k) for fixed
k parser generators, to parse.

Personally, since I'm not responsible for any ES/JS implementation, I
don't care about this difficulty, but a quick search for "ecmascript
lalr" reveals that there are such existing parsers.

P.S. Take everything I say with a grain of salt, since I'm not really an
expert on parsing.


More information about the Es-discuss mailing list