Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39669 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87456 invoked from network); 5 Aug 2008 19:33:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Aug 2008 19:33:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:57471] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/28-03679-C0BA8984 for ; Tue, 05 Aug 2008 15:33:34 -0400 Received: from MBOERGER-ZRH.corp.google.com (unknown [193.142.125.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 07FCE11DB82; Tue, 5 Aug 2008 21:33:28 +0200 (CEST) Date: Tue, 5 Aug 2008 21:32:57 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1665638762.20080805213257@marcus-boerger.de> To: Dmitry Stogov CC: Moriyoshi Koizumi , internals@lists.php.net In-Reply-To: <48983960.3020003@zend.com> References: <909776579.20080803142659@marcus-boerger.de> <4896A7C4.8090503@zend.com> <4110083360.20080804104233@marcus-boerger.de> <4896EA3C.6010203@zend.com> <4897E9B5.9020006@at.wakwak.com> <4897F54F.7080909@zend.com> <96829337.20080805132125@marcus-boerger.de> <48983960.3020003@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Inconsistencies in 5.3 From: helly@php.net (Marcus Boerger) Hello Dmitry, Tuesday, August 5, 2008, 1:28:32 PM, you wrote: > Of course not, but it will be very hard to understand difference and > fix parser conflicts. How is that hard? we have top_statement and inner_statement in our parser...problem solved. Ha, i actually just learned this way that we support inner functions, tsk. marcus > Thanks. Dmitry. > Marcus Boerger wrote: >> Hello Dmitry, >> >> Tuesday, August 5, 2008, 8:38:07 AM, you wrote: >> >>> Allowing "use" inside function body assuming allowing it everywhere. >> >>> $x = function($arg) { >>> if ($arg) { >>> use $a; >>> } else { >>> use $b; >>> } >>> }; >> >>> I don't like such ability and of course we won't be able to use "use" >>> keyword as it will conflict with import statement. >> >> So the import statement use can be placed inside the body of a function as >> an expression? >> >> >>> Moriyoshi Koizumi wrote: >>>> Dmitry Stogov wrote: >>>>> >>>>> Marcus Boerger wrote: >>>>>> Hello Dmitry, >>>>>> >>>>>> Monday, August 4, 2008, 8:55:00 AM, you wrote: >>>>>> >>>>>>> Hi Marcus, >>>>>>> see below >>>>>>> Marcus Boerger wrote: >>>>>>>> Hello Internals, >>>>>>>> >>>>>>>> please let's not introduce new inconsistencies. Rather lets make new >>>>>>>> stuff consistent with old stuff during the alpha phase of 5.3. >>>>>>>> >>>>>>>> 1) new keyword 'use'. Semantically it is the same as 'static' or >>>>>>>> 'global' >>>>>>>> so it should be used in the same location. >>>>>>> For me 'use' is the best keyword as it says that closure uses >>>>>>> variables from current content. (the same keyword is used for import >>>>>>> from namespaces) >>>>>> To be clear, I wasn't complaining about the keyword per se. I just >>>>>> prefer >>>>>> it to be inside the curly braces of a closure next to global rather >>>>>> than in >>>>>> front of it. >>>>>> >>>>> No. The list of lexical variables is a part of the closure definition. >>>>> >>>>> The earlier implementation had "lexical" keyword which worked as you >>>>> are suggesting, but it was much unclear. >>>> I don't think there are many differences in ambiguity between >>>> >>>> $closure = function ($arg) { use $a; >>>> ... >>>> }; >>>> >>>> and >>>> >>>> $closure = function ($arg) use ($a) { >>>> }; >>>> >>>> Moriyoshi >>>> >> >> >> >> >> Best regards, >> Marcus >> Best regards, Marcus