Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18335 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92470 invoked by uid 1010); 24 Aug 2005 04:59:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92439 invoked from network); 24 Aug 2005 04:59:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2005 04:59:02 -0000 X-Host-Fingerprint: 64.233.162.193 zproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.162.193:56203] helo=zproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id E3/DD-28235-69EFB034 for ; Wed, 24 Aug 2005 00:59:02 -0400 Received: by zproxy.gmail.com with SMTP id 8so19658nzo for ; Tue, 23 Aug 2005 21:58:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tVTXfQMEOt8bMei+jXBEXlw+Lz1dDI2/kxs5I8TgZMkMybxWu4I+zlF8SxL/l5lvwCez/MX2bjzmqkt2Q1dRABwEC14eGasjkho/U7gMHvYPTIX7u++AhJWMzTR6wY+2Ki849zBDfmyl+q1MIxUlfn7qAV1gXSn1dxRW/yrYhyY= Received: by 10.36.18.12 with SMTP id 12mr4800119nzr; Tue, 23 Aug 2005 21:58:58 -0700 (PDT) Received: by 10.36.12.5 with HTTP; Tue, 23 Aug 2005 21:58:58 -0700 (PDT) Message-ID: <877e9a17050823215844e885c2@mail.gmail.com> Date: Wed, 24 Aug 2005 00:58:58 -0400 To: Zeev Suraski Cc: Stanislav Malyshev , Marcus Boerger , internals@lists.php.net In-Reply-To: <5.1.0.14.2.20050823220004.07898ec0@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <42FCE0E4.604@lerdorf.com> <4309DC9B.8020904@peda.net> <19310545471.20050822200017@marcus-boerger.de> <877e9a17050822231876308b57@mail.gmail.com> <5.1.0.14.2.20050823220004.07898ec0@localhost> Subject: Re: [PHP-DEV] Re: PHP 6.0 Wishlist From: michael.walter@gmail.com (Michael Walter) Zeev, On 8/23/05, Zeev Suraski wrote: > >"Real" anonymous functions (as in, closures) should be able to capture > >variables from its lexical environment, e.g.: >=20 > create_function() accepts a string, and that string is constructed with > full access to the lexical scope of the creating function, so I'm not > exactly sure how it's different. My ML/LISP memory fails me. It certainly does not appear to be that way in PHP 4, in the supposedly equivalent snippet: function adder($a) {return create_function('$b', 'return $a+$b;');} ..$a is not accessible from inside the anonymous function. This is the reason Stanislav put the content of $a into the code string (and probably the reason he chose adder() instead of index() for his "counter-example" ;). > Since when do we consider moving towards LISP a good thing? :) FWIW, I'm merely explaining the problem, not giving any opinion (too afraid of Derick ;). Cheers, Michael PS: Common Lisps get the garbage collection right, though! ;)