On Jun 15, 2012, at 5:57 PM, satyr wrote:

> On Sat, Jun 16, 2012 at 4:33 AM, David Herman <dher...@mozilla.com> wrote:
> As for null, I can see how there's confusion about whether to use null vs 
> undefined, and so I can see why CoffeeScript would just try to blur the 
> distinction between them.
> 
> Not just for blurring. Rejecting `null` is essential for CoffeeScript's 
> "existence" due to `?.`, the soak/safe access operator.

I think you could make a case for ?. defaulting for both but ?? defaulting only 
undefined. The case goes something like this:

- The purpose of ?? is to provide a default value when no value was provided. 
The way to say "no value" in JavaScript is undefined.

- The purpose of ?. is to fail soft when doing a property lookup. Both null and 
undefined throw when doing a property lookup.

Dave

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

Reply via email to