Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119404 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 72111 invoked from network); 23 Jan 2023 17:31:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jan 2023 17:31:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3B17A1804BE for ; Mon, 23 Jan 2023 09:31:47 -0800 (PST) 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 23 Jan 2023 09:31:47 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DDC5A5C025D for ; Mon, 23 Jan 2023 12:31:46 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Mon, 23 Jan 2023 12:31:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1674495106; x= 1674581506; bh=9r3IsI5dBjxIsn7PdL5jtflQwaa/b51IVfMga6UC15I=; b=g UEz4JuOCtyrR55sc15F5DKGuSLCtJl4U+qQMAEpjMNSkMJeFuKTDaVq6X2NmxsGI 4Lrkh300+xCZy2lFeEAfPIfWN2wTBr9skRM1G1qDxm2yHCf/nLOfl4Aa35qUmGuc pEAGrB9NyZUKjn69eVoJe0uuqvLjwjnWsTcBMmW7K61nc0kpAG/y18Dpq7ZcqxjM wtShjskOYlKFQIbS5LytMJAQgAMBpGhGhy7dXVJrtZtTXYwvGk1f0Ka/9xcooqoW rX9GvaYESayrjLvXEinOMeNZKbsPfpQr1n4Uou46nC/ZSuY47lGiF4yOyBSP9b/O 3rUMCVCh+F6vFgfbdr9iQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674495106; x=1674581506; bh=9r3IsI5dBjxIsn7PdL5jtflQwaa/ b51IVfMga6UC15I=; b=PTiOdQtkAbvtN0ICx5kw5ES13MYIsIZlPUL50UzGZjks v9ZaDHyeXWP/vCpoJG8qUg5bq0JM2MCFWSfPMbhcPYunPM/BxP4sap13aiMGn/5E iS7fVC4TbIuBin01Qq8KfDagQ7hMeA1xJSbDhooCWSF214mVrl8yTtK5kKO6PV++ A9YbdwltQKoDKZrzxlqyJLf72F99eDlCZQBoXNCoMMqpaiZN91b5L0GSxSa5Ik32 8+XRJifeGgMC+85XgYKhwQbaPhAJCwDamrH0zJWAB4lViFfpSclXqQ9LpHyLPQQW qOwzRSmRtPQ+HHxnQJ9nwSBhpm18YFP5aA5tbeFnAA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddukedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeekteelheffgeefvddufeeujeekhfdvtdeuuedvveet ieevheeludegjeduhffhteenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgr rhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id A6C431700090; Mon, 23 Jan 2023 12:31:46 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-85-gd6d859e0cf-fm-20230116.001-gd6d859e0 Mime-Version: 1.0 Message-ID: In-Reply-To: References: <8f530a4a-bf48-4259-877e-16ebf8082936@app.fastmail.com> <88a59c46-9261-43f1-874d-ffc2f9caff32@app.fastmail.com> <99bc38dc-3d62-4a1e-a99c-e5daab3d779f@app.fastmail.com> Date: Mon, 23 Jan 2023 11:31:26 -0600 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Introduce the abiltiy to use the first-call-callable syntax on non-static methods, statically From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jan 23, 2023, at 10:53 AM, Ollie Read wrote: > There's definitely similarity, but I would say it sits somewhere > between the two. Rather than reference a partial method call, or create > a closure for a method, you're delaying a method call. Or rather, > referencing a method. We have the ::class pseudo property, so I see > this like an equivalent, but for methods. So what you're really looking for is a shorter way to write this: foo(fn(Str $s) => $s->beep()); Now you're definitely in the realm of PFA, pipes, and that kind of functionality. And, sadly, Internals has shown a great deal of resistance to that kind of functionality. I have a user-space implementation of pipes that includes utilities to do something similar[1], but most functional languages I know also don't have a really strong native way to "turn around" a call like that. I'd love a solution for that, but so far it has proven both elusive and controversial. --Larry Garfield [1] https://github.com/Crell/fp/blob/master/src/object.php#L28