Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88631 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76594 invoked from network); 2 Oct 2015 01:19:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2015 01:19:41 -0000 Authentication-Results: pb1.pair.com header.from=bishop.bettini@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bishop.bettini@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.177 as permitted sender) X-PHP-List-Original-Sender: bishop.bettini@gmail.com X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:38424] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/51-03039-BABDD065 for ; Thu, 01 Oct 2015 21:19:40 -0400 Received: by wiclk2 with SMTP id lk2so11931881wic.1 for ; Thu, 01 Oct 2015 18:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=l+Kwg+PMj5T8T91rWhHK2oC8aDJQ30ypc+I4+k0tvp8=; b=ycq3hCgzH4cjTtmFbqreSKIys6gHGNXyN41Ib3tYgb3HdG+/1Uq3jogabaaOv18tmT bvAJux9fc6jv+MrhFi1oPrrSQtd4u6tcG0/DUhM9XgMo7eP6ueekPErw6AJm5Jyhc/2G tNBSodvtImM5FsGk83AH48dsXSL/k26fqWHYALJ5uhByTUou9d0Kjw1cp3EWKTTvAp4k MOLuQ3EhZMCO9EXeAKvfk8QD2Az3e5DTN8tniP8eyyqqvKzxw87jhueiLFH7PbNErJWj 9eQvq7hpWhszWaCioHny2VmJHtEDK4aJT7IMNTBah4Ws0sfSZKV6+GWBiaYoziofchKQ vrIQ== MIME-Version: 1.0 X-Received: by 10.180.210.162 with SMTP id mv2mr1400534wic.47.1443748777140; Thu, 01 Oct 2015 18:19:37 -0700 (PDT) Reply-To: bishop@php.net Sender: bishop.bettini@gmail.com Received: by 10.194.110.72 with HTTP; Thu, 1 Oct 2015 18:19:36 -0700 (PDT) In-Reply-To: References: <5606D0EB.3060106@gmail.com> <560D0F94.8060009@gmail.com> <560D282F.6060202@gmail.com> Date: Thu, 1 Oct 2015 21:19:36 -0400 X-Google-Sender-Auth: _LDMk390YnPT9rdmgPk4qqugORw Message-ID: To: Levi Morrison Cc: Anthony Ferrara , Nikita Nefedov , "internals@lists.php.net" , "rowan.collins@gmail.com" Content-Type: multipart/alternative; boundary=001a11c37dae01aca7052114f504 Subject: Re: [PHP-DEV] Arrow function expressions in PHP From: bishop@php.net (Bishop Bettini) --001a11c37dae01aca7052114f504 Content-Type: text/plain; charset=UTF-8 On Thu, Oct 1, 2015 at 1:40 PM, Levi Morrison wrote: > > Or we can figure out some other such symbol. Worse casing no white space, > > brain storming: > > Please, I already asked people to stop making suggestions for shorter > syntax for `use()`. Again, if use() is a pain then auto-importing the > used variables is a good solution. If it's not a pain why are you > suggesting new syntax? > In PHP, I expect to "use" external variables in my closure. I'm taking no stance on whether that's generally a good or bad thing to do in any particular language. I'm saying that, in PHP, that's how its done. It's different from other languages, which can be confusing, as online documentation comments show [1]. But once you've RTM and learned it, you stop thinking about it. It's just what you do. Now enter auto-importing, which is a *great* solution... were it not for precedent, everything else I've learned about closures in PHP, standing in the way. Auto-importing lets me trade convenience of typing fewer characters for a higher cognitive load. I have to remember that PHP behaves differently when I type function vs. fn even though the outcome is the same. I don't consider that a win for the language, because it will cascade to exceptions in the documentation, plenty of SO questions, and probably a PHP Sadness. What I want is a one-to-one behavior mapping between long syntax and short. The syntax suggestions put out on the list attempt to reconcile a great feature with an earnest belief that language consistency trumps typing convenience. [1]: http://php.net/manual/en/class.closure.php#117427 --001a11c37dae01aca7052114f504--