Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54336 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14655 invoked from network); 4 Aug 2011 07:31:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2011 07:31:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=dukeofgaming@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dukeofgaming@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.42 as permitted sender) X-PHP-List-Original-Sender: dukeofgaming@gmail.com X-Host-Fingerprint: 209.85.218.42 mail-yi0-f42.google.com Received: from [209.85.218.42] ([209.85.218.42:60230] helo=mail-yi0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/13-30993-BCA4A3E4 for ; Thu, 04 Aug 2011 03:31:23 -0400 Received: by yih10 with SMTP id 10so1016689yih.29 for ; Thu, 04 Aug 2011 00:31:20 -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=uDSvlbGHc3PxxE3YEDHz0MdScUSRR14BshwFUgy07aU=; b=BoXXF2R8xoA/MOy0h+EA31Lwjhe+cOc4bQi8cmWAWbfhzkcm7n/49wgVJYxrKHdT0i GFRWwC675yXoWYW/5WqEy3XBuyEmVxX6YgIuP5RGKTLHflCkX1w3qN8ILL7FCYNdiC5D 2N1QKzU/K6UqmMpsqAaV6rap03nT2+eME9NMk= Received: by 10.101.191.6 with SMTP id t6mr376525anp.62.1312443080117; Thu, 04 Aug 2011 00:31:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.110.15 with HTTP; Thu, 4 Aug 2011 00:31:00 -0700 (PDT) In-Reply-To: <4E3A48F2.4000503@lerdorf.com> References: <4E3A48F2.4000503@lerdorf.com> Date: Thu, 4 Aug 2011 02:31:00 -0500 Message-ID: To: Rasmus Lerdorf Cc: Lazare Inepologlou , internals@lists.php.net Content-Type: multipart/alternative; boundary=001636c5c288940d5804a9a8f708 Subject: Re: [PHP-DEV] An implementation of a short syntax for closures From: dukeofgaming@gmail.com (dukeofgaming) --001636c5c288940d5804a9a8f708 Content-Type: text/plain; charset=ISO-8859-1 Hi, I've always thought that just supressing the "function" keyword could work as a shorthand, i.e. having ([param1 [, param2 [, ...]]]){...}. Somewhat similar to Ruby's lambda shorthand: http://slideshow.rubyforge.org/ruby19.html#40 Regards, David On Thu, Aug 4, 2011 at 2:23 AM, Rasmus Lerdorf wrote: > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001636c5c288940d5804a9a8f708--