Re: [VOTE] Generators
| From: | Andrew Faulds | Date: | Thu, 30 Aug 2012 09:35:55 +0000 |
| Subject: | Re: [VOTE] Generators | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62597@lists.php.net to get a copy of this message | ||
Derick Rethans <derick@php.net> wrote:
>Nothing shows that they are. In any example I saw, I don't even see any
>
>OO syntax/functionality. For me, "yield" is a core syntax *keyword*,
>and
>hence: no exceptions.
>
I was unware PHP was a purist, non-OOP language. What is "OO syntax" anyway? Why can the
core not use high-level language constructs too?
Yield is core syntax, but it produces a function returning a generator, which is an object, and
since Iterators use Exceptions, it would be stupid for Generators, which *are* a class of Iterator,
not to.
--
Sent from my Android phone with K-9 Mail.
Andrew Faulds
http://ajf.me/