Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84160 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76292 invoked from network); 2 Mar 2015 10:11:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Mar 2015 10:11:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.86 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.86 blu004-omc2s11.hotmail.com Received: from [65.55.111.86] ([65.55.111.86:52971] helo=BLU004-OMC2S11.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/84-48321-D3734F45 for ; Mon, 02 Mar 2015 05:11:10 -0500 Received: from BLU436-SMTP218 ([65.55.111.73]) by BLU004-OMC2S11.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Mon, 2 Mar 2015 02:11:07 -0800 X-TMN: [8KKBFNbe46Di55aSUHkM7grbRpSECh+r] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: Date: Mon, 2 Mar 2015 11:11:02 +0100 CC: Daniel Lowrey , "internals@lists.php.net" Content-Transfer-Encoding: quoted-printable References: To: Niklas Keller X-Mailer: Apple Mail (2.2070.6) X-OriginalArrivalTime: 02 Mar 2015 10:11:05.0129 (UTC) FILETIME=[31A13190:01D054D1] Subject: Re: [PHP-DEV] [RFC Discuss] Generator Delegation From: bobwei9@hotmail.com (Bob Weinand) > Am 02.03.2015 um 01:17 schrieb Niklas Keller : >=20 > 2015-03-02 0:52 GMT+01:00 Daniel Lowrey : >=20 >> Hi folks, >>=20 >> I'd like to initiate discussion on a proposal to implement generator >> delegation via the following new syntax inside generator functions: >>=20 >> yield * >>=20 >> The Generator Delegation RFC is available here: >>=20 >> https://wiki.php.net/rfc/generator-delegation >>=20 >> This proposal is conceptually related to (and requires functionality >> proposed by) the forerunning Generator Return Expressions RFC here: >>=20 >> https://wiki.php.net/rfc/generator-return-expressions >>=20 >>=20 >> Thanks for your time, >>=20 >> Daniel >>=20 >=20 > The proposed syntax has an issue: >=20 > =20 > function a () { > echo yield * 3; > } >=20 > $a =3D a(); > $a->send(42); >=20 > http://3v4l.org/n1sGb#v550 >=20 > This is currently valid PHP. >=20 > Regards, Niklas Hey, I think we could use "yield from" as operator here. Yes, BC. So, I won't make "from" a keyword, but rather specify an own = token for "yield from" (T_YIELD_FROM). That way we have no BC break, except someone tries to yield a constant = named "from". I think that's a really minor break =E2=80=A6 and in case = this breaks someones code, he needs to wrap the constant in parenthesis: = "yield (from)". We can have nice syntax here with a minimal break, so, then, why not? Thanks, Bob=