Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84162 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81140 invoked from network); 2 Mar 2015 10:28:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Mar 2015 10:28:24 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.219 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.219 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.219] ([81.169.146.219:23886] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E1/35-48321-54B34F45 for ; Mon, 02 Mar 2015 05:28:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1425292098; l=5243; s=domk; d=kelunik.com; h=Content-Type:Cc:To:From:Subject:Date:References:In-Reply-To: MIME-Version; bh=noWJ4fyJHxKfFN6HzLBbNc7jfGvTtTRDUU/TlmjA2XM=; b=MeAwYYiKV6fhEdE24zsc/azHsTL9qtuQm7twXATbqpwOn7Sxlj392zMmtLaptEV5qVU nB+kqYJGspUf3Tp+11n4a+UPW2KC1fFcU6oV8yhVPwH7hmF1dxhfhVK98u3CoYgDHmb+n NPPsEvdM6W+u49qmgLTONspW2lC13axq6ck= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLDup6E67mzuoNNBqD/sK4= X-RZG-CLASS-ID: mo00 Received: from mail-wi0-f170.google.com ([209.85.212.170]) by smtp.strato.de (RZmta 37.3 AUTH) with ESMTPSA id u01c23r22ASIp0s (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) for ; Mon, 2 Mar 2015 11:28:18 +0100 (CET) Received: by wibbs8 with SMTP id bs8so13604900wib.4 for ; Mon, 02 Mar 2015 02:28:18 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.11.205 with SMTP id s13mr34300570wib.32.1425292098698; Mon, 02 Mar 2015 02:28:18 -0800 (PST) Received: by 10.27.77.131 with HTTP; Mon, 2 Mar 2015 02:28:18 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Mar 2015 11:28:18 +0100 Message-ID: To: Bob Weinand Cc: Daniel Lowrey , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c23eee3e870705104bad4a Subject: Re: [PHP-DEV] [RFC Discuss] Generator Delegation From: me@kelunik.com (Niklas Keller) --001a11c23eee3e870705104bad4a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2015-03-02 11:11 GMT+01:00 Bob Weinand : > > Am 02.03.2015 um 01:17 schrieb Niklas Keller : > > > > 2015-03-02 0:52 GMT+01:00 Daniel Lowrey : > > > >> Hi folks, > >> > >> I'd like to initiate discussion on a proposal to implement generator > >> delegation via the following new syntax inside generator functions: > >> > >> yield * > >> > >> The Generator Delegation RFC is available here: > >> > >> https://wiki.php.net/rfc/generator-delegation > >> > >> This proposal is conceptually related to (and requires functionality > >> proposed by) the forerunning Generator Return Expressions RFC here: > >> > >> https://wiki.php.net/rfc/generator-return-expressions > >> > >> > >> Thanks for your time, > >> > >> Daniel > >> > > > > The proposed syntax has an issue: > > > > > > > function a () { > > echo yield * 3; > > } > > > > $a =3D a(); > > $a->send(42); > > > > http://3v4l.org/n1sGb#v550 > > > > This is currently valid PHP. > > > > 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 t= his 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 If those keywords can be combined to one, that would be totally fine. I think BC breaks are less a problem when the lexer RFC passes, but that shouldn't lead to a lot more keyboards being added. So yield from will be totally fine, it's already used in other languages. Regards, Niklas --001a11c23eee3e870705104bad4a--