Comprehensions, Where Art Thou?

Brendan Eich brendan at mozilla.org
Mon Aug 11 11:03:23 PDT 2014


Jason Orendorff wrote:
> On Mon, Aug 11, 2014 at 8:03 AM, Kevin Smith<zenparsing at gmail.com>  wrote:
>> >  I still don't quite understand the motivation for removing comprehensions
>> >  from ES6.  They are a well-loved feature of Python and I have every reason
>> >  to believe that they would be well-liked in Javascript.
>
> I agree. It would be great to understand what happened here.
>
> The original rationale was to make room for some more extensible
> comprehension syntax for ES7, but is that really going to happen? Is
> anyone currently interested in championing it?

Dave is waylaid by illness so I'll quickly supply the links to his gists 
showing alternatives to the version of Peter Norvig's Sudoku solver in 
JS that used array comprehensions and generator expressions:

https://github.com/dherman/sudoku

(This is linked to from the meeting notes, under 
http://esdiscuss.org/notes/2014-07-30#4-7-revisit-comprehension-decision-from-last-meeting- 
of course.)

Quoting a bit from Dave's github:

"""

Several different ports of Norvig's Sudoku solver 
<http://norvig.com/sudoku.html> to JavaScript, to elucidate differences 
between a few features:

  * the originally planned ES6 comprehensions;
  * a possible ES7 proposal to generalize and supersede those
    comprehensions;
  * combinator methods with arrow-function shorthand

This is a cleaned up version of this JavaScript port 
<http://mxr.mozilla.org/mozilla-central/source/js/src/tests/ecma_6/Comprehensions/sudoku.js?raw=1>.

"""

HTH,

/be


More information about the es-discuss mailing list