Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53653 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94320 invoked from network); 29 Jun 2011 12:37:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jun 2011 12:37:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=jarrod@squarecrow.com; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=jarrod@squarecrow.com; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain squarecrow.com does not designate 76.96.27.211 as permitted sender) X-PHP-List-Original-Sender: jarrod@squarecrow.com X-Host-Fingerprint: 76.96.27.211 qmta11.emeryville.ca.mail.comcast.net Received: from [76.96.27.211] ([76.96.27.211:58880] helo=qmta11.emeryville.ca.mail.comcast.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/20-26959-A6C1B0E4 for ; Wed, 29 Jun 2011 08:37:00 -0400 Received: from omta07.emeryville.ca.mail.comcast.net ([76.96.30.59]) by qmta11.emeryville.ca.mail.comcast.net with comcast id 1oXV1h0061GXsucABocuwM; Wed, 29 Jun 2011 12:36:54 +0000 Received: from [192.168.1.104] ([98.214.183.20]) by omta07.emeryville.ca.mail.comcast.net with comcast id 1oco1h00m0SpDQq8Uocv9g; Wed, 29 Jun 2011 12:37:02 +0000 Content-Type: multipart/alternative; boundary=Apple-Mail-1-331316901 Date: Wed, 29 Jun 2011 07:36:38 -0500 Message-ID: <1ACBA7A9-A78C-4D7C-8B76-F87EDE13381E@squarecrow.com> Cc: neufeind@php.net To: internals@lists.php.net Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Subject: Re: [PHP-DEV] Inline Lambda Functions From: jarrod@squarecrow.com (Jarrod Nettles) --Apple-Mail-1-331316901 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Stefan, The point was not about array filtering or LINQ or any of that. It was = about the plausibility of using a shorthand for closures. Instead of this..... array_filter($source, function($x){ return $x < 5; }); Being able to do this..... (or something like it). array_filter($source, $x =3D> $x < 5); This would provide a much more friendly way of using callbacks. Lambdas = have great uses, but I feel like they are underutilized in PHP. C#, for = example, has made excellent use of a lambda-friendly syntax like the one = above, and Java is planning something similar (for Java 8, I believe). From: Stefan Neufeind Date: June 28, 2011 2:20:39 PM CDT To: internals@lists.php.net Subject: Re: [PHP-DEV] Inline Lambda Functions On 06/28/2011 03:51 PM, Jarrod Nettles wrote: > There are two projects that I've been following for awhile now: PLINQ > and PHPLinq. > http://plinq.codeplex.com/ > http://phplinq.codeplex.com/ > Both of them have made very solid attempts at providing LINQ-like > functionality to PHP but with both, I've been a little frustrated > with the implementations, due to the wordy syntax that PHP lambda > functions require. [...] Hi, well, for your examples: Why not just array_filter() with an appropriate callback? Should handle it like you describe plinq does it, right? Regards, Stefan= --Apple-Mail-1-331316901--