Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54342 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33846 invoked from network); 4 Aug 2011 08:59:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2011 08:59:05 -0000 Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:36050] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/C2-18399-75F5A3E4 for ; Thu, 04 Aug 2011 04:59:03 -0400 Received: by ywb6 with SMTP id 6so1036416ywb.29 for ; Thu, 04 Aug 2011 01:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=kXFFx3m7FwpLdt/6RZgSp6PZewxmvfCpQgkrO95lKlU=; b=fKzM7nxVVK/JbG9z8D8c3mnEYWf388uzbDNG1LZmeNKCXE1QD4MYprQvz75GHKMl+r XJuf94iOGS0xKQlt5k1YP+m3OAqeOrSWP5NUXDtSz5+vH5TmOrVE2KBnBjXQCuu0tHrI YfykA4AtQVYMJBBld4sCf9MxLiCPMluVPeikE= Received: by 10.146.30.26 with SMTP id d26mr454546yad.25.1312448340180; Thu, 04 Aug 2011 01:59:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.168.19 with HTTP; Thu, 4 Aug 2011 01:58:40 -0700 (PDT) In-Reply-To: <4E3A5D58.9090505@mageekbox.net> References: <4E3A48F2.4000503@lerdorf.com> <4E3A5D58.9090505@mageekbox.net> Date: Thu, 4 Aug 2011 10:58:40 +0200 Message-ID: To: frederic.hardy@mageekbox.net Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=000e0cd4cfc81a41b604a9aa310b Subject: Re: [PHP-DEV] An implementation of a short syntax for closures From: linepogl@gmail.com (Lazare Inepologlou) --000e0cd4cfc81a41b604a9aa310b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, >> $add =3D | $x |=3D> | $y : $x |=3D> $x+$y; > Not sure that it's really readable. This is not the most trivial example. In my blog, there is a small sub-section where I explain why this is more readable than an implementatio= n with the current syntax. See under "Readability" and "A more complicated example". http://linepogl.wordpress.com/2011/08/04/short-closures-for-php-an-implemen= tation/ :-) Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel Le 4 ao=C3=BBt 2011 10:50, Fr=C3=A9d=C3=A9ric Hardy a =C3=A9crit : > Hello ! > >> I've always thought that just supressing the "function" keyword could wo= rk >> as a shorthand, i.e. having ([param1 [, param2 [, ...]]]){...}. Somewhat >> similar to Ruby's lambda shorthand: >> http://slideshow.rubyforge.org/ruby19.html#40 >> >> > Huge +1 for that. > Code using closures will be more readable. > >> $add =3D | $x |=3D> | $y : $x |=3D> $x+$y; >>>> >>>> >>> Not sure that it's really readable. > Moreover, it's more Perl/Ruby way than PHP way. > > Best regards, > Fred > > -- > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Fr=C3=A9d=C3=A9ric Hardy : Architecte d'application/Admin. syst=C3=A8me/E= rgonome > CV : http://blog.mageekbox.net/public/cv.frederic.hardy.pdf > Blog : http://blog.mageekbox.net > Twitter : http://twitter.com/mageekguy > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > --000e0cd4cfc81a41b604a9aa310b--