Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54335 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12838 invoked from network); 4 Aug 2011 07:23:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2011 07:23:37 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.210.43 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.210.43 mail-pz0-f43.google.com Received: from [209.85.210.43] ([209.85.210.43:50182] helo=mail-pz0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/C2-30993-8F84A3E4 for ; Thu, 04 Aug 2011 03:23:36 -0400 Received: by pzk1 with SMTP id 1so726573pzk.2 for ; Thu, 04 Aug 2011 00:23:32 -0700 (PDT) Received: by 10.142.249.27 with SMTP id w27mr526045wfh.78.1312442612550; Thu, 04 Aug 2011 00:23:32 -0700 (PDT) Received: from [192.168.200.5] (c-50-131-46-20.hsd1.ca.comcast.net [50.131.46.20]) by mx.google.com with ESMTPS id i2sm234882wfd.8.2011.08.04.00.23.31 (version=SSLv3 cipher=OTHER); Thu, 04 Aug 2011 00:23:31 -0700 (PDT) Message-ID: <4E3A48F2.4000503@lerdorf.com> Date: Thu, 04 Aug 2011 00:23:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110627 Thunderbird/5.0 MIME-Version: 1.0 To: Lazare Inepologlou CC: internals@lists.php.net References: In-Reply-To: X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] An implementation of a short syntax for closures From: rasmus@lerdorf.com (Rasmus Lerdorf) On 08/04/2011 12:08 AM, Lazare Inepologlou wrote: > $add = | $x |=> | $y : $x |=> $x+$y; This does not seem to match the syntax of any language I know of so people are going to have a hard time figuring out what this does. It's not even clear that |=> is a new operator there due to the dangling |, which as you say conflicts with the regular | operator. Plus it is only useful in one limited type of trivial closure usage. In PHP we try really hard not to invent new unfamiliar syntax. We try to stick with things that have some basis in either the existing syntax or in other popular languages that the average PHP developer might be exposed to. -Rasmus