Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62280 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78437 invoked from network); 20 Aug 2012 08:35:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Aug 2012 08:35:55 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gh0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:53597] helo=mail-gh0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/21-07742-9E6F1305 for ; Mon, 20 Aug 2012 04:35:54 -0400 Received: by ghbg24 with SMTP id g24so5362120ghb.29 for ; Mon, 20 Aug 2012 01:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qiI7iSCvzK5rWctW+ChpagIMc+6kmHOxEMoguC9vJOY=; b=j52d3uspdhyPVt0HGMDengRutzRp5O8rVamrUzhOHflQXp/2uaQYupcHqBbagqHYE1 2AfqxQ3xs91cX9AQ6KNMTPOjG1RpeDzcLQBwx/c88Pu/YmanxC1FdS2Eez/6G2Rlm9E+ inCpP3UyKtjdyadsz6NAqz3QQVDTGoSCbSlEdOIDKObrKgBpWFn5vXtJjrGKTU8xjOo6 f7f0APN+dCVPjJayAXvxx6xUZQxfhH4ymj3Jkk1alApGglg6tsB9V9ZLHhmA2OszH+Vd 98NmiiEBDsTJ8kXPRRWJRt1zC3+6Hx74mpMfgh3dBRAJU2gSWEp/vKS0HU+hd+CvI6Lu kADA== MIME-Version: 1.0 Received: by 10.50.207.65 with SMTP id lu1mr9050566igc.33.1345451750738; Mon, 20 Aug 2012 01:35:50 -0700 (PDT) Received: by 10.64.137.101 with HTTP; Mon, 20 Aug 2012 01:35:50 -0700 (PDT) In-Reply-To: <50317E51.4090305@lerdorf.com> References: <503171CB.3090609@sugarcrm.com> <50317E51.4090305@lerdorf.com> Date: Mon, 20 Aug 2012 10:35:50 +0200 Message-ID: To: Rasmus Lerdorf Cc: Stas Malyshev , Derick Rethans , Nikita Popov , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] Generators From: pierre.php@gmail.com (Pierre Joye) hi Rasmus! On Mon, Aug 20, 2012 at 2:01 AM, Rasmus Lerdorf 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