Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54378 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83719 invoked from network); 4 Aug 2011 18:47:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2011 18:47:09 -0000 Authentication-Results: pb1.pair.com header.from=gwynne@darkrainfall.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=gwynne@darkrainfall.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain darkrainfall.org from 209.85.161.42 cause and error) X-PHP-List-Original-Sender: gwynne@darkrainfall.org X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:56414] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/51-10926-C29EA3E4 for ; Thu, 04 Aug 2011 14:47:09 -0400 Received: by fxe23 with SMTP id 23so2610660fxe.29 for ; Thu, 04 Aug 2011 11:47:04 -0700 (PDT) Received: by 10.223.100.14 with SMTP id w14mr59084fan.67.1312483624348; Thu, 04 Aug 2011 11:47:04 -0700 (PDT) Received: from mail-fx0-f42.google.com (mail-fx0-f42.google.com [209.85.161.42]) by mx.google.com with ESMTPS id h9sm1418537faa.15.2011.08.04.11.47.03 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Aug 2011 11:47:03 -0700 (PDT) Received: by fxe23 with SMTP id 23so2610650fxe.29 for ; Thu, 04 Aug 2011 11:47:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.36.89 with SMTP id s25mr1684131fad.19.1312483623619; Thu, 04 Aug 2011 11:47:03 -0700 (PDT) Received: by 10.223.157.71 with HTTP; Thu, 4 Aug 2011 11:47:03 -0700 (PDT) In-Reply-To: <4E3A9AA9.4010802@daylessday.org> References: <4E3A48F2.4000503@lerdorf.com> <4E3A8014.1030503@rotorised.com> <1312457975.1541.7.camel@guybrush> <4E3A9549.6010803@daylessday.org> <4E3A9AA9.4010802@daylessday.org> Date: Thu, 4 Aug 2011 14:47:03 -0400 Message-ID: To: Antony Dovgal Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] An implementation of a short syntax for closures From: gwynne@darkrainfall.org (Gwynne Raskind) On Thu, Aug 4, 2011 at 09:12, Antony Dovgal wrote: >>> =C2=A0Btw, am I the only one to whom the proposed syntax seems kinda >>> hieroglyphic? >> No. I don't see at all why we need this, just like I don't see why we >> needed an alternative (short) syntax for arrays. This kind of syntax >> additions that add *no* functionality, should not be in PHP. > Yes, I believe we should stop this stream of alternative syntax proposals > and concentrate on fixing existing functionality instead of adding less r= eadable ways to do > the same thing. I would really like to keep PHP code easily readable, not= to turn it into > perl-ish write-only gibberish. 100% agreed, both about the cryptic nature of the proposed syntax and the need to focus on fixing existing issues. Strong -1 on a new syntax. The current PHP syntax for closures is the second-best one I've ever used, IMHO. Clear, readable, explicit. My all-time favorite syntax is that favored by Objective-C: ^ [returntype] ([params]) { code; } The compiler figures out at build time which lexical stuff to capture, and in most cases can infer the optional return type. I'd kinda love a ^ (params) use (captures) { code; } syntax in PHP, but nothing any less wordy than that, and I'd hardly consider it any kind of priority.