Re: Generators in PHP
| From: | Alex Aulbach | Date: | Wed, 25 Jul 2012 23:54:44 +0000 |
| Subject: | Re: Generators in PHP | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61799@lists.php.net to get a copy of this message | ||
2012/7/26 Yahav Gindi Bar <g.b.yahav@gmail.com>:
> "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!
<making gestures>These are not the droids your looking for. Ups. wrong line. :)
--
Alex Aulbach