Re: Reflect.getDefaultParameterValues

2015-10-06 Thread Tab Atkins Jr.
On Mon, Oct 5, 2015 at 9:00 AM, Benjamin Gruenbaum wrote: > Well, I've personally thought about building a small pattern matching > library using the syntax, but that's hardly a general use case: > > ```js > match( > (x = 1) => doFoo(...) > (x = {y : 3}) => doBar(...) > ``` That's just syntax pun

Re: Reflect.getDefaultParameterValues

2015-10-05 Thread Benjamin Gruenbaum
; > > From what I understand (correct me if I'm wrong) - there is no way to > get the default values of a parameter of a function in JavaScript. For > example: > > > > ```js > > function foo(x = 5){ > > > > } > > Reflect.getDefaultParameterValues(

Re: Reflect.getDefaultParameterValues

2015-10-05 Thread Isiah Meadows
have a means to retrieve the default parameter values of a function. > > > > From what I understand (correct me if I'm wrong) - there is no way to > get the default values of a parameter of a function in JavaScript. For > example: > > > > ```js > > function f

Re: Reflect.getDefaultParameterValues

2015-10-05 Thread Thomas
cript. For example: > > ```js > function foo(x = 5){ > > } > Reflect.getDefaultParameterValues(foo); // {x : 5} > ``` > > This would be very nice to have in the language in my opinion. > > Now, doing this right sounds a bit challenging. since default parameter

Re: Reflect.getDefaultParameterValues

2015-10-05 Thread Claude Pache
t. For example: > > ```js > function foo(x = 5){ > > } > Reflect.getDefaultParameterValues(foo); // {x : 5} > ``` > > This would be very nice to have in the language in my opinion. > > Now, doing this right sounds a bit challenging. since default parameters

Reflect.getDefaultParameterValues

2015-10-05 Thread Benjamin Gruenbaum
ipt. For example: ```js function foo(x = 5){ } Reflect.getDefaultParameterValues(foo); // {x : 5} ``` This would be very nice to have in the language in my opinion. Now, doing this right sounds a bit challenging. since default parameters get their value on every invocation of the function, it would