Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47038 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65914 invoked from network); 23 Feb 2010 21:50:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2010 21:50:55 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.117 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.117 us-mr1.zend.com Received: from [63.205.162.117] ([63.205.162.117:33266] helo=us-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/D1-51065-EBD448B4 for ; Tue, 23 Feb 2010 16:50:55 -0500 Received: from us-gw1.zend.com (us-ex1.zend.net [192.168.16.5]) by us-mr1.zend.com (Postfix) with ESMTP id 1E0E143FCE; Tue, 23 Feb 2010 13:49:41 -0800 (PST) Received: from [192.168.16.93] ([192.168.16.93]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 23 Feb 2010 13:50:52 -0800 Message-ID: <4B844DBA.4050804@zend.com> Date: Tue, 23 Feb 2010 13:50:50 -0800 Organization: Zend Technologies User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b2pre Thunderbird/3.0.1 MIME-Version: 1.0 To: Keryx Web CC: internals@lists.php.net References: <4B54FC87.8070106@zend.com> <4F.56.22457.408955B4@pb1.pair.com> <4B55D850.8000604@zend.com> <4B808294.1070801@keryx.se> In-Reply-To: <4B808294.1070801@keryx.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 23 Feb 2010 21:50:52.0331 (UTC) FILETIME=[44C407B0:01CAB4D2] Subject: Re: [PHP-DEV] On closures and lamdba From: stas@zend.com (Stanislav Malyshev) Hi! > My question is not so much about implementation it is about language. I > have noticed quite a few times now that PHP developers use the word > "closure" when I would prefer "lambda". Everybody on the internet knows that Wikipedia is the ultimate source of knowledge, and it says: In computer science, a closure is a first-class function with free variables that are bound in the lexical environment. Such a function is said to be "closed over" its free variables. I think this describes what PHP is doing. > However, in the PHP manual as well as on this list, you seem to be > saying "closure" === "anonymous function" (which is what I'd rather see > called lambda). This is not entirely correct, you are right. There's a difference between anonymous function and closure, though in practice in PHP anonymous functions are closures (though some of them are rather trivial ones with no variables to "close over") and that's now the only way to do closure in PHP (i.e. you can't have non-anonymous closure function). -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com