undefined being treated as a missing optional argument
allen at wirfs-brock.com
Sat Apr 14 12:09:41 PDT 2012
On Apr 13, 2012, at 3:42 PM, Sam Tobin-Hochstadt wrote:
> On Fri, Apr 13, 2012 at 5:42 PM, Brendan Eich <brendan at mozilla.org> wrote:
>> Sam has similar testimony from Racket (neé PLT-Scheme).
> Very much so -- I've encountered places where Racket's semantics for
> keyword arguments (which is similar to what Allen proposes for ES6)
> ends up causing the entire set of keyword arguments to be propagated
> back up the chain and provided in full at every call site.
I'm not so sure that a comparison to keyword arguments is valid. The ES equivalent to keywords is an options object. I think that default argument expressions are are probably only going to be useful when there is one or two of them in a trailing position. For that usage, any combinatory case explosion is going to be at most a small pop.
More information about the es-discuss