Brendan Eich (2013-11-28T18:40:31.000Z)
Kevin Smith wrote:
>
>     function*(a = yield/b/g) {
>       a = yield/b/g;
>     }
>
>
> Why allow yield as an identifier in parameter defaults of generators? 
>  Wouldn't it be simpler just to disallow there as well?

When proposing an irregularity, you need a better reason than "why allow?"

Parameter default values pave a cowpath of the form

   function f(a) {
     a = a || default_a;
     ...
   }

(yes, falsy test and all).

The new form does not desugar that way, of course. But defaults are 
evaluated on each activation (contrast with Python, the mutable value 
default shared singleton side-channel). So why shouldn't yield in a 
default work? There could be a reason, but we don't have it yet.

Allen may have a thought.

/be
domenic at domenicdenicola.com (2013-12-10T01:25:38.556Z)
When proposing an irregularity, you need a better reason than "why allow?"

Parameter default values pave a cowpath of the form

```js
function f(a) {
  a = a || default_a;
  ...
}
```

(yes, falsy test and all).

The new form does not desugar that way, of course. But defaults are 
evaluated on each activation (contrast with Python, the mutable value 
default shared singleton side-channel). So why shouldn't yield in a 
default work? There could be a reason, but we don't have it yet.

Allen may have a thought.