Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65976 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8023 invoked from network); 19 Feb 2013 17:45:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2013 17:45:28 -0000 Authentication-Results: pb1.pair.com smtp.mail=mduarte@inviqa.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mduarte@inviqa.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain inviqa.com from 74.125.82.51 cause and error) X-PHP-List-Original-Sender: mduarte@inviqa.com X-Host-Fingerprint: 74.125.82.51 mail-wg0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:39744] helo=mail-wg0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/81-17768-73AB3215 for ; Tue, 19 Feb 2013 12:45:28 -0500 Received: by mail-wg0-f51.google.com with SMTP id 8so5809587wgl.30 for ; Tue, 19 Feb 2013 09:45:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:mime-version:content-type:from:in-reply-to:date :cc:message-id:references:to:x-mailer:x-gm-message-state; bh=fd2nRQDbXTNXaSrwWnZCPGItOlo2qa9UDKiXZCZCSwI=; b=lMM6XL8Z+TavgtnsLyAWx6InrHmMYQ+JzZGPt7of5+veiBg2K27el6bfl/kE7UeAGq Pc/bOGiXxoX/TWHFLsiuwlIXqC3lYQhf3KCVy9U3BoKhE9dVrFfmxGXBu2ytZh/nbb64 z5R+uFevagTDxGFj5vuvHewAybE5Z6DdRfzD5D0GHZlzxLwzXeGpjm0BjhlwtvcUGOdT OrrXbMpNC5dJjWNnBHntXkzrXli+jNj1Q1zi4JmX3OxGB0XqE0SKsaJsRAX+X5LiQ3SQ qPHecLJs2CW96GBNzWLm/9kde2I8fX4xoBYSNQmEWkQmbxgaf5J0KGLG+eBIVLFDcVD0 quWg== X-Received: by 10.194.83.105 with SMTP id p9mr28230417wjy.56.1361295924784; Tue, 19 Feb 2013 09:45:24 -0800 (PST) Received: from [192.168.2.6] (cpc11-finc13-2-0-cust737.4-2.cable.virginmedia.com. [82.1.90.226]) by mx.google.com with ESMTPS id o8sm26796511wix.7.2013.02.19.09.45.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Feb 2013 09:45:23 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/alternative; boundary=Apple-Mail-8-736631605 In-Reply-To: Date: Tue, 19 Feb 2013 17:45:20 +0000 Cc: Levi Morrison , PHP Internals Message-ID: <08CF292F-2A2E-4C2F-8CB8-6A4B1A91D0F4@inviqa.com> References: <8490FC41-2696-4948-83A1-3931674183B0@gmail.com> <3EBB0AF2-A114-4652-806B-C50DD8F9557D@inviqa.com> To: Leigh X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQll4FbT5Lq+eDO0bOV5tmOdNYa8OaXDbZMs4uSqmm6uTWtTkdlU9bP+AKGIueqTUrkmw+c+ Subject: Re: [PHP-DEV] [RFC] Short syntax for anonymous functions From: mduarte@inviqa.com (Marcello Duarte) --Apple-Mail-8-736631605 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 19 Feb 2013, at 17:32, Leigh wrote: >=20 > On 19 February 2013 16:46, Marcello Duarte wrote: > I find that more and more my developers have to learn ruby just to be = able to work in our projects. We are one of the largest PHP shops in = Europe and even the proprietary tools we are writing for DevOps stuff we = are writing in Ruby. This small syntax arrangement would make it = possible to write DSLs in PHP. The result is that I can have my PHP = developers focusing on one language only and get the job done. The = problem of the web is a bit more complex now, if you look on all you = need to develop and deploy a large PHP application. >=20 > That is one of the choices you made for your projects. You looked at = what was available, and decided that Ruby was the best choice for the = task at hand. >=20 > While I agree it's unfortunate that your developers to have to waste = their time learning Ruby, when they could be doing more productive = things, that doesn't mean it's a good idea to try and retrofit some evil = syntax into PHP "just for you", no matter how large an organisation you = are. I am curious: "evil syntax"? I am not attached to the syntax I have = described. I am open to discuss the syntax. It would be good with using = the callable as last argument converted into a block for DSLs. I don't = think this is evil, but I don't want to fall into a personal taste = debate. I want something I can use. And "just for you" is also inaccurate. You will find that the = technologies I've been referring to are becoming the tools you will use = for DevOps, etc... tasks. Do you guys listen to people outside of = internals? It would be good to have a feedback mechanism that actually = involve PHP developers in real world projects. I take that if you are = coding with other languages like C, all the time, that you may loose = contact with the way things are done. > By the way, PHP is open source, feel free to make the parser do = whatever you want. >=20 >=20 >=20 > On 19 February 2013 16:40, Levi Morrison = wrote: > > Say we agree on the syntax above > >> ($n) |$m| =3D> $m * $n; > > What happens when my one liner function needs to do one more = operation > > like checking the value of $n before multiplication? >=20 > As I stated before suggesting the syntax: It's only meant for a single > expression. It's purposefully NOT intended to cover multiple > expressions. In that case the current (verbose) syntax is better for > all criteria I care about. Additionally, neither Python nor Dart > allows multiple expressions in their short-syntax functions. >=20 > I prefer this. In this case (imho), a simplified syntax *should* go = hand in hand with simplified functionality. If PHP is to adopt such a = syntax I'd much prefer it takes the single expression approach. This = does achieve the goals of easy readability and maintenance because you = know the expression is bound by certain limitations. >=20 -- Marcello Duarte=20 Head of Training Inviqa enterprise open source e-mail: marcello@inviqa.com mobile: +44 78 3316 8193 phone: +44 20 3179 9555 twitter: @_md @Inviqa inviqa.com Disclaimer This email and any attachments may be confidential and are intended = solely for the use of the addressee. Any views or opinions expressed are = those of the author and may not represent those of Inviqa. If you are = not the intended recipient of this email, you must neither take any = action based upon its contents, nor copy or show it to anyone. Please = contact the sender if you believe you have received this email in error. --Apple-Mail-8-736631605--