Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17402 invoked from network); 3 Mar 2015 13:28:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Mar 2015 13:28:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wg0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:39861] helo=mail-wg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/A8-03783-CE6B5F45 for ; Tue, 03 Mar 2015 08:28:13 -0500 Received: by wggx12 with SMTP id x12so39982035wgg.6 for ; Tue, 03 Mar 2015 05:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=7didDxLCf0qqAfhTVqnQsZtmPtJl+k2ptT9izibgNjM=; b=w3eFUXA0Bh3ZBYB+eLJmhYKflyyIjoMZN5tLChbKY+skY/+viL1x71/Pp/hE8+vaJG bwD/+xnJGsQ3s5jLIdvX6QfuAs9YESe7n9EbFk8Xg3CqLtvhqMHhfA2cL89AxnHqgE24 wIXqhSMwOiQdwiz+Tai3BpmlOXF7+WxpNuhNNz1iCXmqIpgJg6wnWPzO3JJ9zbWTCY5B p2gATwuIEpa7AVaMkkm3wGPEqWjWmUnOOc8iHeeyO5n0TXKnnkWZ4oIHS5onyv54N5CK rd1yuRcSaSPkdvUBkt3hIpOmnmfI1SrYtJ0JQOpdawRg6sNu4l/odhxPqs1d+nEAmndE b7yw== X-Received: by 10.180.214.99 with SMTP id nz3mr2934028wic.82.1425389289810; Tue, 03 Mar 2015 05:28:09 -0800 (PST) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id y14sm1303003wjr.39.2015.03.03.05.28.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 05:28:08 -0800 (PST) Message-ID: <54F5B6B4.1000805@gmail.com> Date: Tue, 03 Mar 2015 13:27:16 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Niklas Keller CC: Bob Weinand , Daniel Lowrey , "internals@lists.php.net" References: <54F59C45.7080704@gmail.com> <54F5A8C4.8070508@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------080706060306030403060901" Subject: Re: [PHP-DEV] [RFC Discuss] Generator Delegation From: rowan.collins@gmail.com (Rowan Collins) --------------080706060306030403060901 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Niklas Keller wrote on 03/03/2015 12:52: > 2015-03-03 13:27 GMT+01:00 Rowan Collins >: > > Bob Weinand wrote on 03/03/2015 12:08: > > Why should the word "return" be unique to methods or functions? > > > It just doesn't feel like the same thing as a return value to me, > for the same reason a generator doesn't feel like the same thing > as a function. In "function foo() { return 42; }", "return" means > "this is what you'll get when you run foo()"; in "function foo() { > return 42; yield; }", what you get when you run foo() is a pointer > to the resumable state, and return means "this is what you'll get > if you ask the generator/coroutine instance you get by running > foo() for its final result". > > > It's still different from "return". You said, it "mark[s] the final > result", so I'd expect that finally yielded value would be at the > iterator, but it's not. It's separate. > > How would you call the method then, that makes that "yield final" > value available? You mean instead of ->getReturn()? Something like ->getFinalValue() or ->getFinalResult() Regards, -- Rowan Collins [IMSoP] --------------080706060306030403060901--