instantiating generators

Axel Rauschmayer axel at rauschma.de
Fri Mar 15 12:41:11 PDT 2013


Ah, methods are more tricky! Then you have `this` to contend with.

On Mar 15, 2013, at 20:02 , Brandon Benvie <bbenvie at 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 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 probably have figured it out quicker.
>> 
>> My experience was similar.
> Mine was as well. Admittedly it's kind of odd to use something like `new obj.method` but it does more accurately describe what it was going on.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130315/5c5f734c/attachment.html>


More information about the es-discuss mailing list