Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62597 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20857 invoked from network); 30 Aug 2012 09:36:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2012 09:36:28 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 64.22.89.134 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 64.22.89.134 oxmail.registrar-servers.com Received: from [64.22.89.134] ([64.22.89.134:34325] helo=oxmail.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/D2-02911-9143F305 for ; Thu, 30 Aug 2012 05:36:26 -0400 Received: from [10.126.3.245] (unknown [82.132.239.178]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id EACC3F0013; Thu, 30 Aug 2012 05:36:10 -0400 (EDT) References: <20120829162147.QQCM24459.aamtaout04-winn.ispmail.ntl.com@p2> User-Agent: K-9 Mail for Android In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: Thu, 30 Aug 2012 10:35:55 +0100 To: Derick Rethans ,Gustavo Lopes CC: Nikita Popov ,Jared Williams ,PHP internals Message-ID: <88dcbc07-1e8a-42a5-9816-462f4700f2ab@email.android.com> Subject: Re: [PHP-DEV] [VOTE] Generators From: ajf@ajf.me (Andrew Faulds) Derick Rethans 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/