Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48303 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38274 invoked from network); 17 May 2010 09:48:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 May 2010 09:48:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=mathieu.suen@easyflirt.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mathieu.suen@easyflirt.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain easyflirt.com designates 91.199.255.56 as permitted sender) X-PHP-List-Original-Sender: mathieu.suen@easyflirt.com X-Host-Fingerprint: 91.199.255.56 python-06.easyrencontre.com Linux 2.6 Received: from [91.199.255.56] ([91.199.255.56:44015] helo=mail.easyflirt.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 13/83-13116-FF011FB4 for ; Mon, 17 May 2010 05:48:48 -0400 Received: from [192.168.0.51] (office.easyrencontre.com [78.155.152.6]) by mail.easyflirt.com (Postfix) with ESMTPSA id 09F37636E73 for ; Mon, 17 May 2010 11:48:43 +0200 (CEST) Message-ID: <4BF110FB.3020307@easyflirt.com> Date: Mon, 17 May 2010 11:48:43 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: internals@lists.php.net References: <4BDEC91F.9080305@easyflirt.com> <4BDEEEDA.1050806@cschneid.com> In-Reply-To: <4BDEEEDA.1050806@cschneid.com> Content-Type: multipart/alternative; boundary="------------090103030100090001040404" Subject: Re: [PHP-DEV] Re: Closure local return From: mathieu.suen@easyflirt.com ("mathieu.suen") --------------090103030100090001040404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05/03/2010 05:42 PM, Christian Schneider wrote: > mathieu.suen wrote: > >> May be it could be interesting to have a syntax for returning from the >> define scope. >> For example. >> >> $findedElment = $myList->selectIfAbsent($fooo, function(){ >> return 'No item founded'; //Retrun from the define scope >> }) >> //Do somthing with $findedElment >> > I think you actually misunderstand the difference in > http://en.wikipedia.org/wiki/Closure_%28computer_science%29#Differences_in_semantics > > The way I read if the difference is wether it returns from the closure > function or the surrounding function *calling* it. Not the *defining* scope. > > > And no, it doesn't make sense in the PHP context IMHO. > You need to give me more argument on that point. > - Chris > > -- Mathieu Suen --------------090103030100090001040404--