Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60757 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96132 invoked from network); 6 Jun 2012 10:21:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2012 10:21:06 -0000 Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:49903] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/14-08677-A0F2FCF4 for ; Wed, 06 Jun 2012 06:20:59 -0400 Received: from Hwhost2.local (nsc.ciup.fr [193.52.24.125]) by host1.trois-doubles.net (Postfix) with ESMTPA id 128D52061DB for ; Wed, 6 Jun 2012 12:20:55 +0200 (CEST) Message-ID: <4FCF2F09.8050904@hoa-project.net> Date: Wed, 06 Jun 2012 12:20:57 +0200 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20120604 Thunderbird/14.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Generators in PHP From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") On 05/06/12 19:35, Nikita Popov wrote: > Hi internals! Hi Nikita, > Before going any further I'd like to get some comments about what you > think of adding generator support to PHP. I have always hoped to see the =93yield=94 keywork introduced in PHP. I e= ven=20 suggested that in this mailing-list at least one time but I'm very glad=20 to see some patches coming out. In addition to Gustavo's remarks, I wonder how the GC would collect a=20 Generator object that is not use anymore (especially with a referenced=20 yield). Does it fit to the current CG strategy or do we need an extra=20 strategy? I would notice that the =93Yield by reference=94 section does n= ot=20 exist but you have targeted it). Moreover, I wonder how a =93recursive yield=94 would act (something like = =93public function *f ( =85 ) { =85 yield $this->f(=85); =85 }=94). It is= possible?=20 Is it anticipated? Thanks for you work. Cheers. --=20 Ivan Enderlin Developer of Hoa http://hoa.42/ or http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/