Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34220 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81228 invoked by uid 1010); 22 Dec 2007 18:47:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 81213 invoked from network); 22 Dec 2007 18:47:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2007 18:47:44 -0000 Authentication-Results: pb1.pair.com header.from=troelskn@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=troelskn@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.191 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: troelskn@gmail.com X-Host-Fingerprint: 209.85.198.191 rv-out-0910.google.com Received: from [209.85.198.191] ([209.85.198.191:34049] helo=rv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/30-13243-FCB5D674 for ; Sat, 22 Dec 2007 13:47:44 -0500 Received: by rv-out-0910.google.com with SMTP id k15so661622rvb.23 for ; Sat, 22 Dec 2007 10:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=5mwEes0WEth61p3BsLzP66l4kGtZR9L1rgbm4LrNtNU=; b=R34Co2qzRzIb+DPMl55eJhvmNLxf4IPuFEF/nvDUwzxjGHMtrTIja1TRydFcR10+xNQiVka5NY7Wi0lkw1J8jDsPGLUZlvdFv9mPXL6Aju4jz/5fjqAgOwmxpXAd59h7irqxZ1ZPOrFqQ+bR0T1wMNhQkvtv2zdH2lfa2vf/Wac= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UOE4GpEv9bwYy67OMKHIFDzHXSah43Yb3gpiqxDPFxlMWOzsmYk8nrIpXDcm4O9H9wskPhoXTcnQrkaxtwuxgmwxPHsXiRvQGchKjXxUu53U3YGgmSaWmyKS0fDnt75bh3OM04VpzzFHSthaTSAHru//T13LQgCoOLjr4WJmYJY= Received: by 10.140.179.25 with SMTP id b25mr1516937rvf.186.1198349260753; Sat, 22 Dec 2007 10:47:40 -0800 (PST) Received: by 10.141.50.16 with HTTP; Sat, 22 Dec 2007 10:47:40 -0800 (PST) Message-ID: <98b8086f0712221047j55896376ve55e6bc118bb91bf@mail.gmail.com> Date: Sat, 22 Dec 2007 19:47:40 +0100 To: internals@lists.php.net In-Reply-To: <503D0384-1014-4CD1-BCAC-8F0950D5FC68@bitxtender.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <98b8086f0712150818n40056cedyf0aae7a5a08a27b7@mail.gmail.com> <476582E6.7020808@zend.com> <200712172130.08216.larry@garfieldtech.com> <4FADC266-873E-4FD2-BEC8-28EA9D833297@procata.com> <476D2854.5070803@gmx.net> <503D0384-1014-4CD1-BCAC-8F0950D5FC68@bitxtender.com> Subject: Re: [PHP-DEV] PATCH: Implementing closures in PHP (was: anonymous functions in PHP) From: troelskn@gmail.com ("troels knak-nielsen") I have another observation about names. Instead of using an arbitrary name, as the name of the function, wouldn't it be possible to let the name be derived from the function-body. Eg., if you took the function-body's tokens and created a hash from them. This would have two implications: 1) Multiple definitions of the same function would be optimised into one. And more importantly 2) , it would be possible to serialize/unserialize a closure. Of course, this won't work if an anonymous function is a resource, since resources can't be serialized. This would work for Wez' original patch though. -- troels