I would also like to point out that the ES6 array and generator comprehensions
are very similar to the already existent Array.prototype.forEach() and
Array.prototype.map() methods, both of which are not the most optimal at this
point. Here's some relatively simple examples of this in ES6:
var x = [1, 2, 3, 4, 5];
x = [for (let i of x) i*i];
// fat arrow function not implemented in any JS engine AFAIK
var x = [1, 2, 3, 4, 5];
x = x.map((i) => i*i);
// valid ES5 and ES6
var x = [1, 2, 3, 4, 5];
x = x.map(function (i) { return i*i; });
These syntax changes all but require more optimization of the algorithms for
the Array.prototype.forEach() and Array.prototype.map() methods.
I don't know, though, if array comprehensions allow for void returns inside the
functions executed, because I haven't really gone in depth into that part of
the spec. I know that Haskell does, but Python doesn't, and I don't know about
any other languages for sure. Also, reading the spec doesn't really hint either
way explicitly in the algorithm, but it implies that it should be possible.
There is no mention of anything wrong with any return that the function called
itself doesn't have errors (aka void and undefined returns might be
permissible... I'll have to check with the mailing list).
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.