Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61803 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34991 invoked from network); 26 Jul 2012 06:24:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jul 2012 06:24:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=bschussek@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bschussek@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: bschussek@gmail.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:41154] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/01-19570-182E0105 for ; Thu, 26 Jul 2012 02:24:02 -0400 Received: by yhoo21 with SMTP id o21so1894963yho.29 for ; Wed, 25 Jul 2012 23:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=nMfiaJvJ7ut9Q7lsp/0hPO4WKTnVJYR5E73SZlzy2N8=; b=ZDK22fHFeZ3Jp065NB28QjBBq8nWtYpqKNxvv+L9mRJvTM5AfamX8K/A4+E6isBSzc Z30SdRQ3lCaF2HEyfm+lZwDw5XLJUTqjTgbNQ/1FhrS772ERI2joKpTl7MdqOoFLAXd+ eobCpl26+BUFf15p7H3szNdKRE1wAVlEvt5qQz/a4dwM+Y8mb2sfnz7G8WnWBkNg1/li 1tRbbHlaROx1S0nKxzNDNS1wHp6QSiTQ6qJYyIrDx41PtD3KdMtL4mTNjcXYerOvu9IQ mgXnGH2PDPnKjyt0peec13Y6WwDR1Ro82T/iFC5YQAiHDcMpa+pLyBTA4RBoYAV8qs30 9Tgg== Received: by 10.236.200.132 with SMTP id z4mr26754216yhn.93.1343283838920; Wed, 25 Jul 2012 23:23:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.204.6 with HTTP; Wed, 25 Jul 2012 23:23:28 -0700 (PDT) In-Reply-To: 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> <501033C6.8040603@dmi.me.uk> <7544BE6A-7754-4303-BBCF-3D561FD82963@gmail.com> Date: Thu, 26 Jul 2012 08:23:28 +0200 Message-ID: To: Alex Aulbach Cc: Yahav Gindi Bar , Nikita Popov , Dave Ingram , PHP Development Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Generators in PHP From: bschussek@gmail.com (Bernhard Schussek) I too don't think that a new keyword is necessary for this case. Let's not forget that it is a common practice to document functions with doc blocks, which further helps understanding what it does. /** * @return Generator * @yield string */ function generate() { ... yield $foo; ... } Cheers, Bernhard 2012/7/26 Alex Aulbach : > 2012/7/26 Yahav Gindi Bar : >> "yielder" sounds quite weird don't you think (but my native language is not English too.. so don't blame me at english stupid conclusions!) >> >>> Fact: generator is not a good keyword, because too common. >> I can't see the connection... people relate the generator keyword to the iterators so what's the problem using it? > > PHP will just complain in existing scripts if you use "generator" as > function-name and stops compiling. I think this is stupid, but that's > a completly different discussion. > >> what about using the "iterator" name as generators keyword? because it does return iterators... > > well, wouldn't think, that it can be that easy. > >> iterator foo() { ... yield $bar; ... } sounds OK for me... and got a meaning too. >> though it can confuse some people with the original iterators... > > But it's just what it does. > >> BTW: I still don't think that the generators need a unique word and I suggest using functions, but I didn't read al the mails chain, so I assume that I'll find there the answer. > > Of course you will! > These are not the droids your looking for. Ups. wrong line. :) > > > -- > Alex Aulbach > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >