Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28444 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99922 invoked by uid 1010); 19 Mar 2007 20:58:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99907 invoked from network); 19 Mar 2007 20:58:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 20:58:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=ceo@l-i-e.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ceo@l-i-e.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain l-i-e.com from 67.139.134.202 cause and error) X-PHP-List-Original-Sender: ceo@l-i-e.com X-Host-Fingerprint: 67.139.134.202 o2.hostbaby.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (2) Received: from [67.139.134.202] ([67.139.134.202:2836] helo=o2.hostbaby.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/F0-01604-299FEF54 for ; Mon, 19 Mar 2007 15:58:58 -0500 Received: (qmail 94167 invoked by uid 98); 19 Mar 2007 20:58:57 -0000 Received: from 127.0.0.1 by o2.hostbaby.com (envelope-from , uid 1013) with qmail-scanner-1.25 (clamdscan: 0.88.7/2871. Clear:RC:1(127.0.0.1):. Processed in 0.078461 secs); 19 Mar 2007 20:58:57 -0000 X-Qmail-Scanner-Mail-From: ceo@l-i-e.com via o2.hostbaby.com X-Qmail-Scanner: 1.25 (Clear:RC:1(127.0.0.1):. Processed in 0.078461 secs) Received: from localhost (HELO l-i-e.com) (127.0.0.1) by localhost with SMTP; 19 Mar 2007 20:58:57 -0000 Received: from 216.230.84.67 (SquirrelMail authenticated user ceo@l-i-e.com) by www.l-i-e.com with HTTP; Mon, 19 Mar 2007 15:58:57 -0500 (CDT) Message-ID: <45474.216.230.84.67.1174337937.squirrel@www.l-i-e.com> In-Reply-To: <1174336517.24632.111.camel@blobule> References: <86478A67-DCA2-4000-9EF0-DA4338E8389B@omniti.com> <54922.216.230.84.67.1174335655.squirrel@www.l-i-e.com> <1174336517.24632.111.camel@blobule> Date: Mon, 19 Mar 2007 15:58:57 -0500 (CDT) To: "Robert Cummings" Cc: "Wez Furlong" , internals@lists.php.net Reply-To: ceo@l-i-e.com User-Agent: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Re: [PHP-DEV] PATCH: anonymous functions in PHP From: ceo@l-i-e.com ("Richard Lynch") On Mon, March 19, 2007 3:35 pm, Robert Cummings wrote: > On Mon, 2007-03-19 at 15:20 -0500, Richard Lynch wrote: >> On Sun, March 18, 2007 6:41 pm, Wez Furlong wrote: >> > We've been daydreaming about the ability to do something like this >> in >> > PHP: >> > >> > $data = array("zoo", "orange", "car", "lemon", "apple"); >> > usort($data, function($a, $b) { return strcmp($a, $b); }); >> > var_dump($data); # data is sorted alphabetically >> >> I'd LOVE it if there was SOME difference between this and a normal >> 'function' definition... >> >> I guess we're kind of stuck with 'create_function' being the mess >> that >> it is. >> >> But perhaps something like 'temp_function' or 'local_function' or >> 'lexical_closure' or something similar. Even 'horse' [*] would be >> fine by me. >> >> I think it muddies things too much to have it just be 'function' >> with >> no name after it. >> >> +1 > > A function with a name is no longer anonymous ;) I am not suggesting that there be a name. I am suggesting that the reserved keyword for an anonymous function should not be 'function', the same as a normal function. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?