Fact: Adding a new name for a special kind of function as a syntax
construct is going to cost (possibly unnecessary) time and energy,
because now you have functions, and weird things that look almost like
functions but aren't and can only be used to make generators.
Just to put my oar in too, as an interested watcher...

I don't think that it's a problem (from that point of view) to have a generator keyword. Explicitly declaring up front that it's a generator means that the "return" keyword in the body is always a mistake. Likewise with "function" and "yield". I don't think it would be confusing to have something that looks like a function but isn't completely the same. In fact, it's almost (but not quite) like declaring a return type for the function.


D

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

Reply via email to