Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115208 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11905 invoked from network); 29 Jun 2021 13:06:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jun 2021 13:06:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5064B1804D8 for ; Tue, 29 Jun 2021 06:26:14 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 29 Jun 2021 06:26:13 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id p24so15874389ljj.1 for ; Tue, 29 Jun 2021 06:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=dUZL3cShypPGBykYP0nTxhrs9vSITRA95mzPaQtFKhQ=; b=MzVZX6pxh246YDWx+94exB20WXcuZKMscanEPWI6M8B4GB0CZiAS0C1WeULwfFH5tw rcKAUc5sQjCtkvA/Hmh6vcpKK8Z1tCXqFe5lpbu6XLC9QpJPCJol9UvE7aK9WK2r/Q6A n4frAWiOKiqQ0LfreYMRxuYsUgMlyPDhndCVYWFC7bbljj23cr46U3kN7A3uSBOaw+sY 6Nzzls/MxvAR0XQRURb5mkV3Iah9UjGXjxKbNrFknSAelUhJpeDDk9gJHmqcm3VZEPN/ ILpjeSy4h6TEQHSLHymdJN3a9KFcn7JcsAWqhEQKk/3oBEe2b5tcuq2KcgZX8ZL9wbPg +nrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=dUZL3cShypPGBykYP0nTxhrs9vSITRA95mzPaQtFKhQ=; b=V+wp371R4KKenG9WukDbnlhrzoe2WaVYbjCt24GZcNGfTKkZx9CPSJ4F5M/C9xuUGg YcVA0Aj+H5kZtmFK09bg454hNFuUKPTqNVbkJOPWoq8BKXJ2VZwb/70W9e13MDBVo8nJ 4OkSXSBM2Bo4ghtS/g1yY++tsmEJ40ihJzsTJNsfXPqf8uiRlOhUMSok0IutHUPBY2Og /gXOpBdPrJhqqTfj0Qj76pmDxuooxFZ68o7uW6BCkvKnUqe+kHpHJem7NMZZLL8+atWq 4ATR6s6kArielgIP67+RfuLSDmnJaecah/jZqo4A3Hu8MMeiV4pJfOqDfqYZFuUWg/Ke fzfA== X-Gm-Message-State: AOAM533uf8aA4wlGD4NwjVYLiaf2Qf5wO/QFfStgJV5pd604X6gh3ao8 pat+zQGH1Gn31YlaY9VsBoFSOPgnfglHW6D5jVKS4ck2AFY= X-Google-Smtp-Source: ABdhPJwcK/XeikC50iu+zy0CcvrC8ldCrzhmSFj6gWes66KCINH2c0i8pSyxwCNzt4YaUFbj4PQfpnb4K/l8tAdp1YE= X-Received: by 2002:a2e:94cb:: with SMTP id r11mr4017598ljh.109.1624973170684; Tue, 29 Jun 2021 06:26:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 29 Jun 2021 15:25:54 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000009bb81305c5e78ca1" Subject: Re: [RFC] First-class callable syntax From: nikita.ppv@gmail.com (Nikita Popov) --0000000000009bb81305c5e78ca1 Content-Type: text/plain; charset="UTF-8" On Tue, Jun 29, 2021 at 10:36 AM Nikita Popov wrote: > On Thu, May 20, 2021 at 2:48 PM Nikita Popov wrote: > >> Hi internals, >> >> I'd like to present an RFC for a first-class callable syntax, which is >> intended as a simpler alternative to the partial function application (PFA) >> proposal: >> >> https://wiki.php.net/rfc/first_class_callable_syntax >> >> See the Rationale section for details on how this relates to PFA. Over >> the past week, we've had a lot of discussions on how exactly PFA is >> supposed to work (most of them OTR), and while we seem to have a tentative >> consensus on the correct model to use (which does not match the current >> RFC), it's clear that this feature has turned out more complicated than >> originally anticipated. Joe (who provided the implementation for the PFA >> RFC) is also concerned about the implementation complexity that the final >> model would require. >> >> At least I personally was mainly interested in PFA because it provides a >> first-class callable syntax as a side-effect. This RFC goes back to >> providing *just* that. The syntax is forward-compatible with a future PFA >> proposal though. >> >> Regards, >> Nikita >> > > I've updated the RFC to forbid combination with the nullsafe operator, as > well as explicitly mention strict types behavior, as these came up in the > PFA discussion. > > I plan to put up this RFC for voting in the event that the PFA proposal > does not get accepted. > As syntax has been the primary point of contention for this RFC, I've considered adding a secondary vote for an alternative syntax, with the prime contender being strlen::fn / $foo->bar::fn / Foo::bar::fn. I have ultimately decided against this, because the ::fn syntax is not just a minor syntax variation: It will result in materially different semantics. While the end goal is the same, ::fn would approach it from a technically quite different direction, by not piggy-backing on call syntax. If this doesn't get accepted ("I like the idea but hate the syntax" is a sensible reason to vote against), then I'd create a separate proposal for a different syntax choice. Regards, Nikita --0000000000009bb81305c5e78ca1--