Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112099 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83026 invoked from network); 21 Oct 2020 23:42:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Oct 2020 23:42:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ADD261801FD for ; Wed, 21 Oct 2020 16:00:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 21 Oct 2020 16:00:09 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 959BB1293 for ; Wed, 21 Oct 2020 19:00:07 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute4.internal (MEProxy); Wed, 21 Oct 2020 19:00:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=BQ/pTh NSWMHIQSgd86OA2nnlPhEl/OZjdwqUDSvX+rY=; b=WSRBqWdf6HYe57LpM+lrB9 oDD9goLPpjhE8tUdzy0RosPaK2kgfDsu3Vw6QiUrXgBMWhguw7nPHYdzPDl6+Gqv fO2p2GtNtzPmubb49haz1aWAtp+Laxs6g2NfKOlUumc34kvrQ81Ec3z+AtIYkD6n K9q+ul7X0fZEKAXvLna3pR+9+/+Y1+17bg3aOVLtgZGCxYphAhPKY3TP4gByqnZ0 yrVMqe1Cp9qwov0TbwaBLtLtdHSMftSnA3TGrhNi9jZ+CR7yWAut69AdZIT3pF9j j1HMQkwi1mm1czfn2xpIkO6dcSQgTKQ//Jr2/tLwUWJf+japhqh4QeK3HNKqkQMg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrjeeigddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepgeelgfekudeivddvteffueejffdthfejieevhefgffek udevkedtvdelvddvffefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E00C714200A3; Wed, 21 Oct 2020 19:00:06 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-502-gfef6c88-fm-20201019.001-gfef6c888 Mime-Version: 1.0 Message-ID: <1fa2a1ab-ab11-4725-9df0-dcdfb3860af6@www.fastmail.com> In-Reply-To: References: <812317f5-dd87-497b-b483-bc3b7f3c2e7d@www.fastmail.com> Date: Wed, 21 Oct 2020 17:59:41 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Short-function syntax From: larry@garfieldtech.com ("Larry Garfield") On Wed, Oct 21, 2020, at 5:17 PM, Rowan Tommins wrote: > It occurred to me recently that maybe we could make "function" and "fn" > synonyms everywhere, i.e. make both "$double = function($x) => $x *2;" > and "$double = fn($x) use ($x) { return $x *2; };" valid. I'm not sure > if that's desirable, or even if there's a reason it can't be done, but > it would mean you don't have to make a decision on this RFC... Sara mentioned that as well. I can see the appeal, but at the same time I foresee that leading to a question about when to use which, divergent coding standards with different people doing it differently and different projects eventually adopting different standards, eventually a PSR that attempts to standardize it, probably by proposing the same "when it's a short-function of some kind" rule, and only some projects adopt it. Basically, a mess. Whatever we do, it should be language-consistent so that there's no bikeshed potential. --Larry Garfield