Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18336 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2133 invoked by uid 1010); 24 Aug 2005 05:24:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2117 invoked from network); 24 Aug 2005 05:24:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2005 05:24:16 -0000 X-Host-Fingerprint: 64.233.162.192 zproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.162.192:11507] helo=zproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 7D/6E-28235-0840C034 for ; Wed, 24 Aug 2005 01:24:16 -0400 Received: by zproxy.gmail.com with SMTP id 8so21341nzo for ; Tue, 23 Aug 2005 22:24:13 -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=BQHq/8WGtrwRZYMsVgOihKUIlKf8WnPl2yrYDUN16vEGhkOUxbxWvHGeZ1NCL43Fj8M8xiciDlPfemOtbjo2N4wpLSblbDRNcLDfacrWEEDdq5UTaVQxN0ch/LciS/DCFnhrwq8wc7odF2Ne43DvS7F4HWbwElJfGVXv76yOZBk= Received: by 10.36.227.59 with SMTP id z59mr151202nzg; Tue, 23 Aug 2005 22:24:13 -0700 (PDT) Received: by 10.36.12.5 with HTTP; Tue, 23 Aug 2005 22:24:13 -0700 (PDT) Message-ID: <877e9a1705082322241fc30bca@mail.gmail.com> Date: Wed, 24 Aug 2005 01:24:13 -0400 To: Zeev Suraski Cc: Stanislav Malyshev , Marcus Boerger , internals@lists.php.net In-Reply-To: <877e9a17050823215844e885c2@mail.gmail.com> 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> <877e9a17050823215844e885c2@mail.gmail.com> Subject: Re: [PHP-DEV] Re: PHP 6.0 Wishlist From: michael.walter@gmail.com (Michael Walter) Zeev, On 8/24/05, Michael Walter wrote: > 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.: > > > > 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. I misread. The obvious difference is that you're not creating code strings in ML/LISP, so (1) you can avoid all kind of error-prone marshalling and (2) you can compile the function at compile-time and simply fill out its free variables when "instantiating" the closure (using the current lexical environment), giving you syntax checks & performance. I intentionally phrased that sentence to resemble object instantiation: In fact it's pretty much the same thing with more less verbose/local syntax! I.e. as I believe you said, it is certainly *not* a question of how/whether we want that functionality, but whether we want to encourage this particular style of programming. Cheers, Michael