Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61796 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78880 invoked from network); 25 Jul 2012 22:31:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2012 22:31:54 -0000 Authentication-Results: pb1.pair.com header.from=g.b.yahav@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=g.b.yahav@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: g.b.yahav@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:33300] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/80-08189-9D370105 for ; Wed, 25 Jul 2012 18:31:53 -0400 Received: by weyr1 with SMTP id r1so1012216wey.29 for ; Wed, 25 Jul 2012 15:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=50RD7pzGKTt9r7arR+bibfwPCh7gPHA1mSRkld5/BKw=; b=BjMd8r32cPRpbSY+ge3ll0LTDZAVUPunYpHIOz7XMwUCRzUFvhX/8XacVUKGs28n7d dQucglDNmQI+7RtVEZPdjkicSOWJgGxIIZlwF/k0k1haztUF1thGL+I+fxCnNamniLZQ dfT7DqP2PalTjBnxg6KBexyJLDlyGifrl8dpVvrU/kvBtmClIyk9SwmqwyWGLcIRzUIL 7sp92DgabtIj59czpQGRZUTBFneknpDdc1yEa8qRpN/nq/pbTr32h88rOM8zggwfYUpi 9sNq4qds1i0ht10ZmZabead1LWy4aUijAqQlc6xb3QWBMdYS1Osrb4IqVS1PvMm47m43 bMKQ== Received: by 10.180.76.36 with SMTP id h4mr8182745wiw.13.1343255510393; Wed, 25 Jul 2012 15:31:50 -0700 (PDT) Received: from [10.0.0.3] ([109.64.148.5]) by mx.google.com with ESMTPS id l5sm7440162wix.5.2012.07.25.15.31.48 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jul 2012 15:31:49 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) In-Reply-To: Date: Thu, 26 Jul 2012 01:31:47 +0300 Cc: Nikita Popov , Dave Ingram , PHP Development Content-Transfer-Encoding: quoted-printable Message-ID: <7544BE6A-7754-4303-BBCF-3D561FD82963@gmail.com> Uza8GE6Q-D3aAoQ94NEpcutquM+svj+VbA@mail.gmail.com> To: Alex Aulbach X-Mailer: Apple Mail (2.1485) Subject: Re: [PHP-DEV] Generators in PHP From: g.b.yahav@gmail.com (Yahav Gindi Bar) On 26 =D7=91=D7=99=D7=95=D7=9C 2012, at 01:22, Alex Aulbach = wrote: > 2012/7/25 Nikita Popov : >> particular with namespaced code). So if you have some kind of >> Code\Generator class, you're screwed. >> Keywords don't grow on trees, you know ;) >=20 > Hm. Ok, thats a problem. > Oh, man, do I really have to find a good keyword myself? Maybe we > should use a password-generator. :) > Seriously, how's about >=20 > yielder hugo() { ... yield ...} >=20 > Feels right, but my native language is not english, so I risk to make > me a fool. I think that also names what it really is: A yielder yields > something. In this case: An iterator yielder yields an iteration. I > think I would like that. > And the word is per sure not common. :) > Ahmm, if you don't like it, would you be so kind to make a suggestion? = TNX >=20 >> Also I'd like to point out that being similar to other languages is = in >> the general case a *good* thing. So if you say "It doesn't matter how >=20 > In general I agree. For PHP I do not. This case is a little bit > different, because the targets are self-explaining and simplicity. >=20 >> Deviating from the >> "standard" generator implementation without having good reasons seems >> rather pointless to me. >=20 > But I gave good other reasons. :) >=20 >=20 >=20 > Conclusion: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Fact: generator is not a good keyword, because too common. >=20 > Answer: I made a new sugestion with the keyword "yielder". >=20 > Fact: in general it's a good idea to implement features, like in other > languages. >=20 > A: Correct, but >=20 > Fact: PHP has different architectural targets which doesn't mean to > make everything different, but ... > Experience: in this case I'm sure, it's not the best way to make it > like any other language. > Experience: If you have enough reasons to make things different, don't > look too much how others are doing. > Experience: Most PHP-programmers are not so experienced like most > programmers in other languages. > (Can't be proven, but I would bet for it.) >=20 > --=20 > Alex Aulbach >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 Wow, I wasn't near my computer for the last day and I see that the = conversation really grew ;) "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? what about using the "iterator" name as generators keyword? because it = does return iterators... iterator foo() { ... yield $bar; ... } sounds OK for me... and got a = meaning too. though it can confuse some people with the original iterators... 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.=