Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48181 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48694 invoked from network); 3 May 2010 16:03:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2010 16:03:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.216 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.218.216 mail-bw0-f216.google.com Received: from [209.85.218.216] ([209.85.218.216:42320] helo=mail-bw0-f216.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/87-09795-7D3FEDB4 for ; Mon, 03 May 2010 12:03:36 -0400 Received: by bwz8 with SMTP id 8so1462882bwz.23 for ; Mon, 03 May 2010 09:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=FYuN3poYyTGmQflZNB7gfK/IR/EzYHC6LrUInkZgAL8=; b=G1li2SnJtZP1RleqI8lHM6odjkk8qMHCgTbv3DZ2oSkmwsiCp7bZpNXy/jicVFaHhk DWA2jqnWooC1yONGXEdqeCcyljnK+0AmIBe5eJsYPxP4gXgJhzkZu7jGmQHvWluldEAi owstiGdqBFZcU7Gv+O/6KOlkQjy179jaI717o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=U9Bzg34E1q8Q8H2PMuXdCKUssO282RpY7VpxmZZ6IPHdtTRA6OqnmHeWR8wOAhgUIM /45sN1ZuIsbm8aaWc7jDC/1qfQ3b9yrxr4+60Kiojj6av79sRvP8kbVc44fOVZ9RvQvu U+4n3pnepwq+H9pwmDbJQeBNoiLIDyelhtJC4= MIME-Version: 1.0 Received: by 10.204.6.25 with SMTP id 25mr4852740bkx.135.1272902611703; Mon, 03 May 2010 09:03:31 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.56.72 with HTTP; Mon, 3 May 2010 09:03:31 -0700 (PDT) In-Reply-To: <4BDEF1AF.70704@easyflirt.com> References: <4BDEC91F.9080305@easyflirt.com> <4BDEEEDA.1050806@cschneid.com> <4BDEF1AF.70704@easyflirt.com> Date: Mon, 3 May 2010 18:03:31 +0200 X-Google-Sender-Auth: b39d55384ab1159e Message-ID: To: "mathieu.suen" Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: Closure local return From: webmaster@colder.ch (Etienne Kneuss) On Mon, May 3, 2010 at 5:54 PM, mathieu.suen w= rote: > >> 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))) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0x) > > (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. So would it be an infinite loop? would it print end? what about: ". Best, > > > -- Mathieu Suen > > > --=20 Etienne Kneuss http://www.colder.ch