On Apr 13, 2011, at 8:46 PM, Dmitry A. Soshnikov wrote:

>> I had dinner with Jeremy Ashkenas last month, and he testified that 
>> CoffeeScript's disamgibuator pass (between lexing and parsing) is a work in 
>> progress and a work of (literately programmed) random logic, which he has 
>> tweaked based on user bug reports, even recently.
>> 
> You mean it was hard for Coffee to implement this foo?.bar? etc?

Not really given Coffee's lack of ?: as ternary operator.

But in general, we can't harvest syntax from CoffeeScript without bottom-up, 
ASI-aware grammar validation.

It is easy to go wrong.


> Hm, not good. The whole ambiguity of this construct with casual a ? : c 
> already makes it not good for me. And by the way, Coffee didn't have ? : it 
> uses inline if - then instead.
> 
> (well, actually it's possible to write in Coffee a = b ? b : c, but it 
> compiles into completely different semantics).

Right!


> in my view, the operator is not "?." (i.e. "a question followed by a dot"), 
> but still just ?. The following dot is already about property accessor:
> 
> foo.bar?.baz
> 
> again, bar? is separated, and only after that it's accessed to `baz` via 
> casual dot notation.

?. is doable as a new operator, but we need a better quantification of how 
useful it is in CS.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to