In the ideal (from my point of view) world, no object will have both an
iterator() and a next() method together (so Iterator and Iterable would be
different entities; the first having an internal state, and the second
stateless). So your example would be:
var iterable = getSomeIterable();
var i =
On Mar 14, 2013, at 8:01 PM, Andreas Rossberg rossb...@google.com wrote:
Yes. Iterators have a next method, that's all what makes them an
iterator, according to the wiki, and having an iterator method is
never mentioned there.
It's mentioned on the iterators proposal page as
Anyway, my questions are cleared up (for now). Can't wait for those wiki
updates! ; )
Ah - one more comment.
The signatures for `load` and `evalAsync` indicate that they will return
`this`, a reference to the loader. These functions are prime candidates
for returning futures (e.g.
We discussed the factoring of the generator object model at the Nov 27
meeting. In the notes
https://github.com/rwldrn/tc39-notes/blob/master/es6/2012-11/nov-27.md there is
a sketch of the hierarchy we agreed to:
https://dl.dropbox.com/u/3531958/tc39/generator-diagram-1.jpg
The design Andy
I would prefer having to use `new` (but don’t have strong feelings about it):
generators are more like constructors than like functions. When I first started
experimenting with them in Firefox, it took me a while to figure that out (even
though it is obvious in hindsight). With `new`, I’d
On Mar 14, 2013, at 3:20 AM, Paul Ruizendaal wrote:
There seems to be ambiguity over the semantics of Date.parse() in the spec
(both 5.1 and latest 6 draft).
The spec says: The String may be interpreted as a local time, a UTC time,
or a time in some other time zone, depending on the
On Mar 15, 2013, at 11:22 AM, Axel Rauschmayer wrote:
I would prefer having to use `new` (but don’t have strong feelings about it):
generators are more like constructors than like functions. When I first
started experimenting with them in Firefox, it took me a while to figure that
out
On 3/15/2013 11:51 AM, Allen Wirfs-Brock wrote:
On Mar 15, 2013, at 11:22 AM, Axel Rauschmayer wrote:
I would prefer having to use `new` (but don't have strong feelings
about it): generators are more like constructors than like functions.
When I first started experimenting with them in
Ah, methods are more tricky! Then you have `this` to contend with.
On Mar 15, 2013, at 20:02 , Brandon Benvie bben...@mozilla.com wrote:
On 3/15/2013 11:51 AM, Allen Wirfs-Brock wrote:
On Mar 15, 2013, at 11:22 AM, Axel Rauschmayer wrote:
I would prefer having to use `new` (but don’t have
Yeah but since the generator holds the initial |this| for its lifetime you can
treat it kind of like a bound function.
On Mar 15, 2013, at 12:41 PM, Axel Rauschmayer a...@rauschma.de wrote:
Ah, methods are more tricky! Then you have `this` to contend with.
On Mar 15, 2013, at 20:02 ,
On Fri, Mar 15, 2013 at 11:51 AM, Allen Wirfs-Brock
al...@wirfs-brock.com wrote:
On Mar 15, 2013, at 11:22 AM, Axel Rauschmayer wrote:
I would prefer having to use `new` (but don’t have strong feelings about
it): generators are more like constructors than like functions. When I first
started
On Mar 15, 2013, at 1:18 PM, Tab Atkins Jr. wrote:
On Fri, Mar 15, 2013 at 11:51 AM, Allen Wirfs-Brock
al...@wirfs-brock.com wrote:
On Mar 15, 2013, at 11:22 AM, Axel Rauschmayer wrote:
I would prefer having to use `new` (but don’t have strong feelings about
it): generators are more like
for what is worth it, agreed with Tab Atkins here ... `new` does not
improve much semantically speaking, it's actually just confusing, IMHO
On Fri, Mar 15, 2013 at 1:18 PM, Tab Atkins Jr. jackalm...@gmail.comwrote:
On Fri, Mar 15, 2013 at 11:51 AM, Allen Wirfs-Brock
al...@wirfs-brock.com
On Fri, Mar 15, 2013 at 1:22 PM, Allen Wirfs-Brock
al...@wirfs-brock.com wrote:
Agree that requiring new would be ackward. But permitting it seems reasonable.
Yeah, I see no value in making new invalid.
~TJ
___
es-discuss mailing list
Tab Atkins Jr. wrote:
On Fri, Mar 15, 2013 at 11:51 AM, Allen Wirfs-Brock
al...@wirfs-brock.com wrote:
On Mar 15, 2013, at 11:22 AM, Axel Rauschmayer wrote:
I would prefer having to use `new` (but don’t have strong feelings about
it): generators are more like constructors than like functions.
but then the direction is a bit inconsistent since native constructors are
going to require `new
On Fri, Mar 15, 2013 at 1:36 PM, Brendan Eich bren...@mozilla.com wrote:
Tab Atkins Jr. wrote:
On Fri, Mar 15, 2013 at 11:51 AM, Allen Wirfs-Brock
al...@wirfs-brock.com wrote:
On Mar 15,
(sorry, I sent by accident) I meant native requires `new` and there is
already a subset, generators, that are flexible as native constructors are
now (e.g. Object() instead of new Object())
anyway, better than mandatory `new` so ...
On Fri, Mar 15, 2013 at 1:59 PM, Andrea Giammarchi
That sounds reasonable to me.
Dave
On Mar 15, 2013, at 11:01 AM, Kevin Smith khs4...@gmail.com wrote:
Anyway, my questions are cleared up (for now). Can't wait for those wiki
updates! ; )
Ah - one more comment.
The signatures for `load` and `evalAsync` indicate that they will
I don't know what you meant below in the first paragraph, but I'm going
to assume you agree that 'new' should not be required for generators. :-|.
/be
Andrea Giammarchi wrote:
(sorry, I sent by accident) I meant native requires `new` and there is
already a subset, generators, that are
On Fri, Mar 15, 2013 at 11:22 AM, Axel Rauschmayer a...@rauschma.de wrote:
I would prefer having to use `new` (but don’t have strong feelings about
it): generators are more like constructors than like functions. When I
first started experimenting with them in Firefox, it took me a while to
I'm doing a little maintenance on SES. Chrome has recently added a new
odd behavior:
var o = Object.create(null);
Object.getOwnPropertyNames(o)
[]
Object.getOwnPropertyDescriptor(o, '__proto__');
Object {value: null, writable: true, enumerable: false, configurable: false}
The two results are
Kevin Reid wrote:
I'm doing a little maintenance on SES. Chrome has recently added a new
odd behavior:
var o = Object.create(null);
Object.getOwnPropertyNames(o)
[]
Object.getOwnPropertyDescriptor(o, '__proto__');
Object {value: null, writable: true, enumerable: false, configurable: false}
On 03/14/2013 04:14 PM, Brendan Eich wrote:
Andreas Rossberg wrote:
On 14 March 2013 23:38, Brendan Eichbren...@mozilla.com wrote:
Andreas Rossberg wrote:
That leaves my original proposal not to have generator application
return an iterator, but only an iterable. Under that proposal, your
I agree on that and on top I would rather throw if `new` is used ... but I
understand on being permissive, is just weird `Object()` instead of `new
Object()` won't be accepted anymore, but for generators there is such
exception. This is all I was trying to say.
On Fri, Mar 15, 2013 at 3:48 PM,
V8 now uses an accessor on Object.prototype.
On Mar 15, 2013 7:20 PM, Brendan Eich bren...@mozilla.com wrote:
Kevin Reid wrote:
I'm doing a little maintenance on SES. Chrome has recently added a new
odd behavior:
var o = Object.create(null);
Object.getOwnPropertyNames(o)
[]
On Fri, Mar 15, 2013 at 11:22 AM, Axel Rauschmayer a...@rauschma.de wrote:
I would prefer having to use `new` (but don’t have strong feelings about it):
generators are more like constructors than like functions. When I first
started experimenting with them in Firefox, it took me a while to
Andrea Giammarchi wrote:
I agree on that and on top I would rather throw if `new` is used ...
That might be ok. The newborn passed in as this could be returned via
first yield, though, so while it's an odd thing to take advantage of,
the semantics of new and function* combine without harm.
27 matches
Mail list logo