Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38411 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46995 invoked from network); 19 Jun 2008 15:33:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2008 15:33:59 -0000 X-Host-Fingerprint: 200.150.147.21 unknown Received: from [200.150.147.21] ([200.150.147.21:24024] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/CB-10717-56C7A584 for ; Thu, 19 Jun 2008 11:33:58 -0400 Message-ID: <7E.CB.10717.56C7A584@pb1.pair.com> To: internals@lists.php.net Date: Thu, 19 Jun 2008 12:36:03 -0300 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 References: <4856A547.3080801@gmx.net> <485A35A0.9050602@zend.com> <485A63C7.5020600@gmail.com> <485A6F0C.4090809@zend.com> In-Reply-To: <485A6F0C.4090809@zend.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 200.150.147.21 Subject: Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP From: rodrigo.saboya@bolsademulher.com (Rodrigo Saboya) Dmitry Stogov escreveu: > I don't like "lexical" keyword, because it can be used anywhere in > function (e.q. inside "if" or loop statement), however lexical variables > must be the part of lambda function definition. I agree with Dmitry: Lexical variables belong to lambda function definition. It makes more sense to me. But I also agree that the proposed syntax might be a little misleading. > We can think about some better syntax, like > > function ($x, $y) ($a, $b, $c) {}; This looks better > function ($x, $y) [$a, $b, $c] {}; Array confusion is to be expected with this syntax, I don't like it. FWIW, I'd like to see this on 5.3. regards Rodrigo Saboya > I like "|" separator more, but the syntax of definition is not so > important for me. It just must be clean, and the "lexical" keyword > doesn't provide clean definition. > > I don't like the idea to add methods at runtime, as it can break shared > data structures in multi-threaded environment. > > Thanks. Dmitry.