Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42754 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16775 invoked from network); 21 Jan 2009 17:13:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jan 2009 17:13:05 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 209.85.221.20 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 209.85.221.20 mail-qy0-f20.google.com Received: from [209.85.221.20] ([209.85.221.20:47597] helo=mail-qy0-f20.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/A5-19181-1A757794 for ; Wed, 21 Jan 2009 12:13:05 -0500 Received: by qyk13 with SMTP id 13so3684105qyk.23 for ; Wed, 21 Jan 2009 09:13:02 -0800 (PST) Received: by 10.214.44.2 with SMTP id r2mr988856qar.146.1232557982455; Wed, 21 Jan 2009 09:13:02 -0800 (PST) Received: from pcp041215pcs.unl.edu (pcp041215pcs.unl.edu [129.93.124.154]) by mx.google.com with ESMTPS id 8sm4946627qwj.53.2009.01.21.09.13.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jan 2009 09:13:01 -0800 (PST) Message-ID: <4977579B.2060300@chiaraquartet.net> Date: Wed, 21 Jan 2009 11:12:59 -0600 User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070807) MIME-Version: 1.0 To: Dmitry Stogov CC: Marcus Boerger , internals@lists.php.net, Lukas Kahwe Smith , =?UTF-8?B?Sm9oYW5uZXMgU2NobMO8dGVy?= References: <272365052.20090104173130@marcus-boerger.de> <4964A69F.2060103@zend.com> In-Reply-To: <4964A69F.2060103@zend.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [RFC] Closures, Lambdas and use From: greg@chiaraquartet.net (Greg Beaver) Dmitry Stogov wrote: > Personally I like the current syntax more and don't see any reason to > change it. > > Thanks. Dmitry. > > Marcus Boerger wrote: >> Hello Internals, Dmitry, Lukas, Johannes, >> >> some time back (August 08) I complained about 'use' being at a weird >> position and not at the same place as 'global' or 'static' where I >> expected it. Back then Dmitry asked me to provide a patch to check out >> the alternative. Now during the holidys I finally found some time to >> change from: >> $f = function() use ($x) {} >> to: >> $f = function() { use $x; } >> >> Patch is attached. >> >> Comments? I think the current syntax may be clearer: The second version requires a visual re-parsing, the first is clear at a glance. In addition, if support for namespaced variables was ever introduced, confusion would abound. Thanks, Greg P.S. happy new year (I'm a bit slow)