Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65968 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92510 invoked from network); 19 Feb 2013 16:45:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2013 16:45:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=sean@seancoates.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sean@seancoates.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain seancoates.com from 64.15.79.181 cause and error) X-PHP-List-Original-Sender: sean@seancoates.com X-Host-Fingerprint: 64.15.79.181 iconoclast.caedmon.net Received: from [64.15.79.181] ([64.15.79.181:41688] helo=iconoclast.caedmon.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/5E-17768-43CA3215 for ; Tue, 19 Feb 2013 11:45:40 -0500 Received: from localhost (localhost [127.0.0.1]) by iconoclast.caedmon.net (Postfix) with ESMTP id EEEEB78405C; Tue, 19 Feb 2013 11:37:03 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at iconoclast.caedmon.net Received: from iconoclast.caedmon.net ([127.0.0.1]) by localhost (iconoclast.caedmon.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wUM7wSKEtmPP; Tue, 19 Feb 2013 11:36:54 -0500 (EST) Received: from [10.8.0.2] (sarcasm.vpn [10.8.0.2]) by iconoclast.caedmon.net (Postfix) with ESMTPSA id 82BCA784056; Tue, 19 Feb 2013 11:36:53 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Tue, 19 Feb 2013 11:45:26 -0500 Cc: Florin Razvan Patan , Marcello Duarte , PHP Internals Content-Transfer-Encoding: 7bit Message-ID: References: <8490FC41-2696-4948-83A1-3931674183B0@gmail.com> To: Levi Morrison X-Mailer: Apple Mail (2.1085) Subject: Re: [PHP-DEV] [RFC] Short syntax for anonymous functions From: sean@seancoates.com (Sean Coates) >> Say we agree on the syntax above >>> ($n) |$m| => $m * $n; >> What happens when my one liner function needs to do one more operation >> like checking the value of $n before multiplication? > > As I stated before suggesting the syntax: It's only meant for a single > expression. It's purposefully NOT intended to cover multiple > expressions. In that case the current (verbose) syntax is better for > all criteria I care about. Additionally, neither Python nor Dart > allows multiple expressions in their short-syntax functions. Have you considered how this will work/look in an array? $a = [$b => ($n) $m => $m * $n]; // wat. S