On 07/25/2012 04:25 PM, Alex Aulbach wrote:
> In 50 lines of code yield will be just overseen.
> 
> But I meant something different: I thought of documentation. Maybe
> someone reads the docs. Really! In the docs he will find functions.
> And in the function this "yield". He dosn't want to know that. It
> makes stress. "Why do I need to know how yield functions work, I
> barely understand functions."
> So this is systematically wrong. Right would be, that yield is an own
> chapter. Will be easier if a generator is not a function.

I'm with Sara on this one. A generator is enough like a function that we
don't need a new keyword for it. We typically don't get too pedantic in
PHP concepts and try to keep things simple. What we call an array isn't
technically an array either. It's an ordered map, but it looks enough
like an array that it is simpler to just call it that.

And objects technically have methods or member functions, not functions,
but we don't have a method/member keyword either.

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to