Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48180 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44550 invoked from network); 3 May 2010 15:54:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2010 15:54:29 -0000 Authentication-Results: pb1.pair.com header.from=mathieu.suen@easyflirt.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=mathieu.suen@easyflirt.com; spf=pass; 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:46040] helo=mail.easyflirt.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/A6-09795-2B1FEDB4 for ; Mon, 03 May 2010 11:54:28 -0400 Received: from [192.168.0.51] (office.easyrencontre.com [78.155.152.6]) by mail.easyflirt.com (Postfix) with ESMTPSA id 786AE6365B1 for ; Mon, 3 May 2010 17:54:23 +0200 (CEST) Message-ID: <4BDEF1AF.70704@easyflirt.com> Date: Mon, 03 May 2010 17:54:23 +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="------------030501060202080407060302" Subject: Re: [PHP-DEV] Re: Closure local return From: mathieu.suen@easyflirt.com ("mathieu.suen") --------------030501060202080407060302 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > 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. > > - Chris > > "returns from the closure function" To go were? I had maintain a smalltalk compiler. I did not misunderstand the difference. The Common Lisp implementation is the more explicit one. For exemple: (defun eval-l1 (fct) (funcall fct)) (defun bar (x) (eval-l1 #'(lambda () (return-from bar 45))) x) (bar 23) -> 45 When funcall is apply you do not return from eval-l1. You return from bar. Which is the defining scope of the lanbda. -- Mathieu Suen --------------030501060202080407060302--