Re: Fwd: .next('yo') in newborn generators

2014-02-20 Thread David Bruant
Le 20/02/2014 06:39, Brendan Eich a écrit : Bradley Meck wrote: If I am reading the spec right (and I may not be), only the generator should fail? The first call to gen().next(value) must have value be undefined, and the others do not check. I thought we agreed at the January 28 meeting to

Final iterator spec

2014-02-20 Thread joe
A while back, the wiki Harmony draft spec for iterators changed from a Pythonic StopIteration approach to one where iterator objects return a {value : iter-value, done : bool} object. It since seems to have changed back. Is that the case, or am I misreading the situation? It seems that Tracuer

Re: Final iterator spec

2014-02-20 Thread Brandon Benvie
What you're probably seeing is that the wiki no longer has up to date information. As things have been fully fleshed out in the es6 draft spec, the wiki is no longer up to date. To answer your question, the iterator protocol hasn't changed back to using StopIteration. It's still { value, done

Re: Final iterator spec

2014-02-20 Thread joe
Thanks. Btw, where is the final spec stored? On Feb 20, 2014 3:53 AM, Brandon Benvie bben...@mozilla.com wrote: What you're probably seeing is that the wiki no longer has up to date information. As things have been fully fleshed out in the es6 draft spec, the wiki is no longer up to date.

Re: Final iterator spec

2014-02-20 Thread Juan Ignacio Dopazo
On Thursday, February 20, 2014 9:27 AM, joe joe...@gmail.com wrote: Thanks.  Btw, where is the final spec stored? You can find it in the Drafts page:  http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts. harmony:specification_drafts [ES Wiki]Draft Specification for ES.next

Re: can delegating yield be as fast as a normal function call?

2014-02-20 Thread Andy Wingo
Hi, This isn't really an es-discuss topic, as it is about performance of implementations rather than the language itself. On Wed 12 Feb 2014 18:08, Jelle van den Hooff je...@vandenhooff.name writes: Do the delegating yield semantics allow a VM to transform nested yield* calls into normal

Re: can delegating yield be as fast as a normal function call?

2014-02-20 Thread David Bruant
Le 20/02/2014 15:03, Andy Wingo a écrit : Hi, This isn't really an es-discuss topic, as it is about performance of implementations rather than the language itself. Stating my own opinion only on behalf of myself: I think this thread appropriate for es-discuss. How developers use the language

What does is not present mean in spec algorithms?

2014-02-20 Thread Boris Zbarsky
Consider http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.splice step 10. It uses the phrasing if deleteCount is not present but I can't find anything in the specification defining the concept of present or not present. So it's hard for me to tell what behavior this

Re: What does is not present mean in spec algorithms?

2014-02-20 Thread Boris Zbarsky
On 2/20/14 12:09 PM, Allen Wirfs-Brock wrote: Boris should file a bug. Done. https://bugs.ecmascript.org/show_bug.cgi?id=2559 Thanks, Boris ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: What does is not present mean in spec algorithms?

2014-02-20 Thread Rick Waldron
On Thu, Feb 20, 2014 at 12:11 PM, Boris Zbarsky bzbar...@mit.edu wrote: On 2/20/14 11:16 AM, Allen Wirfs-Brock wrote: Nope, it means that the length of the argument list is less than two, hence an argument corresponding to 'deleteCount' was not passed. OK. In that case, I think this term

Re: What does is not present mean in spec algorithms?

2014-02-20 Thread Allen Wirfs-Brock
On Feb 20, 2014, at 9:11 AM, Boris Zbarsky wrote: On 2/20/14 11:16 AM, Allen Wirfs-Brock wrote: Nope, it means that the length of the argument list is less than two, hence an argument corresponding to 'deleteCount' was not passed. Would you prefer it to say If fewer than two arguments were

Re: What does is not present mean in spec algorithms?

2014-02-20 Thread Boris Zbarsky
On 2/20/14 12:24 PM, Allen Wirfs-Brock wrote: Would you prefer it to say If fewer than two arguments were passed, then let deleteCount be ...? That would be clearer, yes, if we want to stick to natural language here. It avoids confusion about undefined == missing issues, for sure, and

Detecting a Module object

2014-02-20 Thread Guy Bedford
If Module objects are not classes, then what would be the recommended way to detect if a given object is a Module? Would there be a unique toString output? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Another switch

2014-02-20 Thread Eric Elliott
Object literals are already a great alternative to switch in JS: var cases = { val1: function () {}, val2: function () {} }; cases[val](); Fall through is more trouble than it's worth, IMO. On Feb 17, 2014 1:44 PM, Giacomo Cau cau.giacomo...@tiscali.it wrote: -Messaggio

Re: Detecting a Module object

2014-02-20 Thread Allen Wirfs-Brock
On Feb 20, 2014, at 11:47 AM, Guy Bedford wrote: If Module objects are not classes, then what would be the recommended way to detect if a given object is a Module? Would there be a unique toString output? Can't. 'toString' might be a binding exported by a module so a module object can

Re: Detecting a Module object

2014-02-20 Thread Guy Bedford
Thanks, if there is some way to detect this it may well be useful. The use case I came across it was trying to allow ES6 modules to be transpiled into AMD for use in an ES6 loader. I'm still not sure how necessary the use case is, but it definitely would need this functionality work. On 20

Re: Detecting a Module object

2014-02-20 Thread Allen Wirfs-Brock
On Feb 20, 2014, at 12:53 PM, Guy Bedford wrote: Thanks, if there is some way to detect this it may well be useful. The use case I came across it was trying to allow ES6 modules to be transpiled into AMD for use in an ES6 loader. I'm still not sure how necessary the use case is, but it

Re: Detecting a Module object

2014-02-20 Thread John Barton
On Thu, Feb 20, 2014 at 1:01 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Feb 20, 2014, at 12:53 PM, Guy Bedford wrote: Thanks, if there is some way to detect this it may well be useful. The use case I came across it was trying to allow ES6 modules to be transpiled into AMD for

Re: Detecting a Module object

2014-02-20 Thread Guy Bedford
Thanks John for explaining. As for the usefulness of this path as I say it is yet to be determined. Specifically the ability to detect a module instance is needed to allow ES6 loaders to load AMD that was transpiled from ES6 into AMD. It may be a little bit of an obscure use case, the exact

Re: Another switch

2014-02-20 Thread Mathias Bynens
On 20 Feb 2014, at 21:20, Eric Elliott e...@ericleads.com wrote: Object literals are already a great alternative to switch in JS: var cases = { val1: function () {}, val2: function () {} }; cases[val](); In that case, you’d need a `hasOwnProperty` check to make sure you’re not