On Jun 19, 2012, at 12:26 PM, Brendan Eich wrote:

> Brendan Eich wrote:
>> Worse, instead of leaking an observable ConditionalReference (whew!), you've 
>> opted to break the equivalence between foo.bar() and %tmp = foo.bar; 
>> %tmp.call(foo) for the case where . is replaced by ?. -- in this case your 
>> proposal does not throw while the expansion does.
>> 
>> The right extension for what CoffeeScript calls ?( is simply to use an 
>> unambiguous and backward-compatible extension, such as ?.( instead. 
> 
> Jeremy pointed out privately that the need for ?( is less acute in practice, 
> and also because of .call via the equivalences:
> 
>  foo.bar?(args) <==>  foo.bar?.call(foo, args)
>  fun?(args) <==>  fun?.call(undefined, args)

How are these equivalent? Won't  fun?.call evaluate to undefined if fun is 
undefined and undefined(undefined,args) will throw...

Allen


> 
> But ?.( is shorter. It's awkward to use three chars instead of CoffeeScript's 
> two, and to have a dot in the middle where no get or set is implied.
> 
> /be
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to