Re: Array Comprehensions

2017-04-16 Thread Allen Wirfs-Brock
See
https://github.com/tc39/tc39-notes/blob/master/es6/2014-06/jun-5.md#generator-comprehensions-slides-plz

https://speakerdeck.com/dherman/a-better-future-for-comprehensions


https://github.com/tc39/tc39-notes/blob/master/es6/2014-07/jul-30.md#47-revisit-comprehension-decision-from-last-meeting

On Apr 16, 2017, 9:36 AM, at 9:36 AM, "Herby Vojčík"  wrote:
>Ryan Birmingham wrote:
>> Hello all,
>>
>> I frequently find myself desiring a short array or generator
>> comprehension syntax. I'm aware that there are functional ways around
>> use of comprehension syntax, but I personally (at least) love the
>syntax
>> in the ES reference
>>
>(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Array_comprehensions).
>>
>> The best previous discussion on this that I found was six years old
>> (https://esdiscuss.org/topic/array-comprehensions-shorter-syntax) and
>> answers some of my questions, raising others. That said, I wanted to
>ask:
>>
>>   * Why is the Comprehension Syntax in the reference yet not more
>> standard? It feels almost like a tease.
>
>IIRC, it was discussed here throroughly for ES6 (~2yrs ago?) and it was
>
>rejected in favour of .map/.filter/arrays fns.
>
>>   * How do you usually approach or avoid this issue?
>>   * Do you think we should look at improving and standardizing the
>> comprehension syntax?
>>
>>
>> Thank you all for humoring me,
>>
>> -Ryan Birmingham
>>
>> ___
>> 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
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: Array Comprehensions

2017-04-16 Thread Herby Vojčík

Ryan Birmingham wrote:

Hello all,

I frequently find myself desiring a short array or generator
comprehension syntax. I'm aware that there are functional ways around
use of comprehension syntax, but I personally (at least) love the syntax
in the ES reference
(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Array_comprehensions).

The best previous discussion on this that I found was six years old
(https://esdiscuss.org/topic/array-comprehensions-shorter-syntax) and
answers some of my questions, raising others. That said, I wanted to ask:

  * Why is the Comprehension Syntax in the reference yet not more
standard? It feels almost like a tease.


IIRC, it was discussed here throroughly for ES6 (~2yrs ago?) and it was 
rejected in favour of .map/.filter/arrays fns.



  * How do you usually approach or avoid this issue?
  * Do you think we should look at improving and standardizing the
comprehension syntax?


Thank you all for humoring me,

-Ryan Birmingham

___
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


Re: Array Comprehensions

2017-04-16 Thread Cyril Auburtin
I often use

```js
Array.from({length: n}, (_, i) => i**2)
Array.from({length: n}, (_, i) => Array.from({length: n}, (_, j) => i*j))
[].concat(...Array.from({length: n}, (_, i) => Array.from({length: n}, (_,
j) => ({i,j,v:i*j} // flattened
```

2017-02-07 23:13 GMT+01:00 kdex :

> AFAIK, only TC39 members can champion a proposal.
>
> If you're not a member, you could still write a proposal and hope that
> some TC39 member is interested in championing it.
>
> On Tuesday, February 7, 2017 5:05:49 PM CET Ryan Birmingham wrote:
> > It wasn't clear from the documentation; who can or cannot be a champion?
> >
> > -Ryan Birmingham
> >
> > On 7 February 2017 at 10:49, Bob Myers  wrote:
> >
> > > On Tue, Feb 7, 2017 at 6:58 PM, David Bruant 
> wrote:
> > >
> > >> At the very least, the proposal will be listed in the stage 0
> proposals
> > >> list [3].
> > >
> > >
> > > My understanding is that a champion is required even to become stage 0.
> > >
> >
> ___
> 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