Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114538 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44223 invoked from network); 20 May 2021 16:12:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 May 2021 16:12:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E94AD1804D8 for ; Thu, 20 May 2021 09:22:30 -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,NICE_REPLY_A,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 forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) (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 ; Thu, 20 May 2021 09:22:30 -0700 (PDT) Received: from iva1-9e0def03149c.qloud-c.yandex.net (iva1-9e0def03149c.qloud-c.yandex.net [IPv6:2a02:6b8:c0c:9281:0:640:9e0d:ef03]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 00B6C4B00582 for ; Thu, 20 May 2021 19:22:28 +0300 (MSK) Received: from iva7-f62245f79210.qloud-c.yandex.net (iva7-f62245f79210.qloud-c.yandex.net [2a02:6b8:c0c:2e83:0:640:f622:45f7]) by iva1-9e0def03149c.qloud-c.yandex.net (mxback/Yandex) with ESMTP id AhypTDO4TZ-MRJCfXok; Thu, 20 May 2021 19:22:27 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=softsatsistemas.com.br; s=mail; t=1621527747; bh=PcoGGVzMdWxyMLcIvBNwhknjyZh1/bmfTN42IVJztJk=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=slZKLZBLpetOydSYAPnTvYQ5yo0dZiUSziNEtKZcNN5WpY96F6wQNWH6JGzyBfFEk MOpwxwhnQ5c7uG4czAIY4Y/7G+DNNjn1eMv13ePNd3mc+xp8QxD/Weducw+5rPpqtE zMpK10kGetsUWOelInqX+LCYfn8/g/FQBo0gjqyQ= Authentication-Results: iva1-9e0def03149c.qloud-c.yandex.net; dkim=pass header.i=@softsatsistemas.com.br Received: by iva7-f62245f79210.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id KV55Kii312-MPN83pSr; Thu, 20 May 2021 19:22:26 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) To: internals@lists.php.net References: Message-ID: <8c37bfe0-bf64-43ad-e553-165a4cab63b3@softsatsistemas.com.br> Date: Thu, 20 May 2021 13:22:22 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: pt-BR Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] First-class callable syntax From: luis@softsatsistemas.com.br (Luis Henrique) On 20/05/2021 12:55, Guilliam Xavier wrote: > On Thu, May 20, 2021 at 5:12 PM Nikita Popov wrote: > >> On Thu, May 20, 2021 at 4:16 PM Ondřej Mirtes wrote: >> >>> Hi, I’m confused by the syntax, when I read it, I think to myself “I know >>> this, this is just a method call… oh wait, it’s actually a callable”. It >>> really makes my head hurt. >>> >> >> Yes, I can see how that could be confusing. The current syntax is chosen to >> be a subset of the partial function application proposal. However, I would >> also be happy with some other syntax that makes it clearer that this is >> acquiring a callable and not performing a call. >> > > Hi, several other syntaxes have been proposed to consideration in the PFA > thread, and I wouldn't want to start new bikeshedding here; is there a > place that would be more appropriate to gather the possibilities (like a > kind of updatable list)? > > Thanks, > I am much more into advanced features of PFA, but is this case why not just use the & operator for "function reference" like C/C++? It is well known and solves the ambiguity with method/function call. $fn = &$this->myFunc; $fn = &myFunc; $fn = &Foo::myFunc;