Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65961 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81389 invoked from network); 19 Feb 2013 16:09:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2013 16:09:13 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.47 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.219.47 mail-oa0-f47.google.com Received: from [209.85.219.47] ([209.85.219.47:43306] helo=mail-oa0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/FB-17768-7A3A3215 for ; Tue, 19 Feb 2013 11:09:12 -0500 Received: by mail-oa0-f47.google.com with SMTP id o17so7017359oag.6 for ; Tue, 19 Feb 2013 08:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=f5yWcFMY+eix/8EZoxqvmvGIFqA0qQT9RkBYaCjWQpc=; b=lcZkMb5btRhvMJkx/yyDfW+Vcvek2Z7T/JDYZHl4uwWVMNoLEtE+htlfJeD0DQNxCd gedprhfMncZd/Jb4L29Rs8LN4g5AUATbBNk1y/OGe0yx9JE5JPp1PcnVxV65oIbHB/p0 j8usHIKR+C2fk7//j5xBFn4/wr+JXEOzA6GQO5cFu0qYFyDRQZVzpHKWlddgaQpah0GM fN6ilNM4dbwfbangy1WBsMxNfgHJRKJDHjVUZnS6X8G580h9zf/cZOuNnvm0zlTB27o2 huyO5uKcK04WQVDwy0UKqQRr670n+BOTpC6q8e4WXjcUMKtXeNGJMo58Pr+tngdxcoCU XNag== MIME-Version: 1.0 X-Received: by 10.182.245.33 with SMTP id xl1mr7672394obc.91.1361290148581; Tue, 19 Feb 2013 08:09:08 -0800 (PST) Received: by 10.76.24.234 with HTTP; Tue, 19 Feb 2013 08:09:08 -0800 (PST) In-Reply-To: <8490FC41-2696-4948-83A1-3931674183B0@gmail.com> References: <8490FC41-2696-4948-83A1-3931674183B0@gmail.com> Date: Tue, 19 Feb 2013 09:09:08 -0700 Message-ID: To: Marcello Duarte Cc: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] Short syntax for anonymous functions From: morrison.levi@gmail.com (Levi Morrison) There's already been an overwhelming negative reaction to this particular proposed syntax so I won't belabor the point much. In short, this is too similar to block statements and does have BC issues. -- IF (and I stress if) we add a a shorter anonymous function syntax I'd like it to be geared towards one-liners because that's where the current syntax feels really verbose, especially when you close over other variables: function ($n) use ($m) { return $m * $n; } Versus one potential option: ($value) |$m| => $m * $n; This syntax is short and expressive at the expense of clarity. Basically all short-syntax has that trade-off, so I am personally fine with it. The only other potential problem I see is parsing it; someone more familiar with PHP's parser would have to verify whether that would be a problem.