Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61786 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54014 invoked from network); 25 Jul 2012 17:58:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2012 17:58:14 -0000 Authentication-Results: pb1.pair.com header.from=dave@dmi.me.uk; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dave@dmi.me.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain dmi.me.uk designates 94.23.241.19 as permitted sender) X-PHP-List-Original-Sender: dave@dmi.me.uk X-Host-Fingerprint: 94.23.241.19 scara-new.siterage.net Received: from [94.23.241.19] ([94.23.241.19:38260] helo=scara-new.siterage.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/BD-19281-4B330105 for ; Wed, 25 Jul 2012 13:58:13 -0400 Received: from lightb0x.zapto.org (unknown [109.231.200.166]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: dave@dmi.me.uk) by scara-new.siterage.net (SiteRage Mail Server) with ESMTPSA id BD4CE1FD44 for ; Wed, 25 Jul 2012 18:58:09 +0100 (BST) X-DKIM: Sendmail DKIM Filter v2.8.3 scara-new.siterage.net BD4CE1FD44 DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=dmi.me.uk; s=scara-dkim; t=1343239089; bh=rJLjBCbJd2AJbeWgiNVPtlbbA04=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Riead6VKNuE7mfFD27MtR/sjIktkfhKN/e+kZF1IFCaPOXHsvDx+priweiqrZ4v5i gxtkdUXt2eLusmP/EQrOul2UqdE++59NALgB62Q1ZrPdmeQaa4rFN6hPESQ0bci8KV 9JelKjkhzvU2kE/lH2Tp0Y3PEZ1D3Yny6cIZqJyk= Message-ID: <501033C6.8040603@dmi.me.uk> Date: Wed, 25 Jul 2012 18:58:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120616 Thunderbird/13.0.1 MIME-Version: 1.0 To: PHP Development References: <500EDCC7.1020402@ajf.me> <500EE3B9.8010902@ajf.me> <500EEA76.1030407@ajf.me> <5010138D.5050804@ajf.me> <501015B9.6050704@ajf.me> <501026DB.6030507@ajf.me> In-Reply-To: <501026DB.6030507@ajf.me> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: Generators in PHP From: dave@dmi.me.uk (Dave Ingram) > Fact: Adding a new name for a special kind of function as a syntax > construct is going to cost (possibly unnecessary) time and energy, > because now you have functions, and weird things that look almost like > functions but aren't and can only be used to make generators. Just to put my oar in too, as an interested watcher... I don't think that it's a problem (from that point of view) to have a generator keyword. Explicitly declaring up front that it's a generator means that the "return" keyword in the body is always a mistake. Likewise with "function" and "yield". I don't think it would be confusing to have something that looks like a function but isn't completely the same. In fact, it's almost (but not quite) like declaring a return type for the function. D