Re: [RFC] Generators

From: Date: Mon, 20 Aug 2012 08:35:50 +0000
Subject: Re: [RFC] Generators
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-62280@lists.php.net to get a copy of this message
hi Rasmus! On Mon, Aug 20, 2012 at 2:01 AM, Rasmus Lerdorf <rasmus@lerdorf.com> wrote: > I would still like to understand what this generator keyword would > actually do. I don't see how it would work. Would a function marked > generator somehow not be allowed to return normally or to finish and not > return anything? How could this be enforced? I am completely against any > keyword that is essentially documentation-only. It is not documentation only (or should not but I have to check the implementation). It allows the use of the generators features inside this function. Just like what we have for static methods and this (somehow). Also I would really not begin to totally rethink the way generators work or are defined. There are clean and known ways in other languages, the closer we get from them the easier it will be to learn how to use them in PHP. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

« previous php.internals (#62280) next »