On Apr 15, 2011, at 2:39 AM, John J Barton wrote:

> P T Withington wrote:
>> This is the way AS2 worked.  If at any point an undefined value was hit 
>> (whether property access or call), the evaluation stopped and undefined was 
>> returned.  The experience of OpenLaszlo was that this led to many myserious 
>> bugs.  We ended up making our compiler insert annotations in debug mode to 
>> detect and warn when an expression failed due to an undefined value.  That 
>> experience makes me believe that the current behavior in ES is a better 
>> default; but having a shorthand for "stop now if this is undefined", seems 
>> like it would be a nice addition.
> [snip]

> So you could make the argument that the Dmitry thing ought to work with the 
> debugger. Rather than a mysterious 'undefined' you should have a a way to 
> rapidly ask  the debugger to tell you: which link in the chain is 
> 'undefined'. And that is what you did in your compiler: a good solution to 
> your problem but not an argument against the syntax IMO.

Seems to me Tucker was pretty clearly arguing that ?. should be explicit as in 
CoffeeScript, not implicit and inevitable via . as in AS2. That's all.

I agree with Oliver, we can probably make ?. and ?( work in JS.

CoffeeScript has it easy on several counts beyond not having ?: in the first 
place:

* single open source implementation, the code is the spec.
* rapid evolution by user-testing, no formal grammar.

The last could be considered a hardship, not having it easy.

In any event, suffice to say that ECMA-262 can't follow this methodology. We 
need multiple browser engine implementors to buy in. We need a formal spec 
that's sound and valid first.

It would be good to hear from spec gurus and more implementors.

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

Reply via email to