Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61795 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77188 invoked from network); 25 Jul 2012 22:22:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2012 22:22:18 -0000 Authentication-Results: pb1.pair.com header.from=alex.aulbach@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=alex.aulbach@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: alex.aulbach@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:42200] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/30-08189-99170105 for ; Wed, 25 Jul 2012 18:22:18 -0400 Received: by yenl12 with SMTP id l12so1543593yen.29 for ; Wed, 25 Jul 2012 15:22:13 -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=L4DkSuQl5nXMhjIBT9/Ph/zRny40GkHEpc2SNwkfNz8=; b=afn6quLODIhXvgxe21bvxmRfAnyLYgPl08t0lN/ay1eWaOSmX0YlFfm8ZtPytbAyqs 9U5oqCXWKXEqDIx2rI1LNrDgOBR2R7TQSG78KAWKLzSuDpQnOzlLuSW04+TZeBHaKMil LPEDRK1n93u6iXjn2wXKnnoayf6DKUbsf90Ju9U9rDhv7VePAFTQ1cW8thXIffW9Tqqf q0vba4mMPecCTE8MxkPWIACBBuT/2c4PvnoKQvi16983GrUmZ8kPJ/ERYwdd0Udwue/k IKcmrKznngdrviYAg/knWIIPCIYVU0w5jzg8RpNNYt/bAKehXM/w+TsuEYzTHcg4qt6s rXLg== MIME-Version: 1.0 Received: by 10.50.85.196 with SMTP id j4mr139006igz.30.1343254933560; Wed, 25 Jul 2012 15:22:13 -0700 (PDT) Received: by 10.64.44.234 with HTTP; Wed, 25 Jul 2012 15:22:12 -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> Date: Thu, 26 Jul 2012 00:22:12 +0200 Message-ID: To: Nikita Popov Cc: Dave Ingram , PHP Development Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Re: Generators in PHP From: alex.aulbach@gmail.com (Alex Aulbach) 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 ;) 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 yielder hugo() { ... yield ...} 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 > 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 In general I agree. For PHP I do not. This case is a little bit different, because the targets are self-explaining and simplicity. > Deviating from the > "standard" generator implementation without having good reasons seems > rather pointless to me. But I gave good other reasons. :) Conclusion: ========== Fact: generator is not a good keyword, because too common. Answer: I made a new sugestion with the keyword "yielder". Fact: in general it's a good idea to implement features, like in other languages. A: Correct, but 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.) -- Alex Aulbach