Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114414 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 541 invoked from network); 11 May 2021 16:51:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 May 2021 16:51:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4A3131804DA for ; Tue, 11 May 2021 09:59:32 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, LOTS_OF_MONEY,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-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (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, 11 May 2021 09:59:31 -0700 (PDT) Received: by mail-oi1-f176.google.com with SMTP id d21so19610510oic.11 for ; Tue, 11 May 2021 09:59:31 -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 :cc; bh=XRzgW2PjkFsiSjrcEV2YFkIqOg80Q3PBIaDfVkasHak=; b=ek0oYbTPlMwcArHjgn6EPYET6E2TVdF+3Xnxnx2bgn6Igf6ARgmtLNJrT0ZIS7PLjr ywOLmEnOskLxiwxOT5ZgLxvVC+VF7CMwsnf2ykT/LtrZLu/ZXxffk6VSEA9B74u2tIPS R8W09/H3vbAwwAV5roY5883qk+VypArTsCklRrFocs9wU00k/X7RjPV1jfELQLBHNLQX TrP0ew/PrBu/c2DDDKhuA5EYFRO//saIqFZxmRqZFZ35PHoyHzRuPqXWdPv/wsw+SFWP eyUwL0PCe2dE4G1XGCARYoJLbTnoimEtuMkN26EhlgQFK6/vVugtECPZv3g3bfyjOIfu 8oaw== 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:cc; bh=XRzgW2PjkFsiSjrcEV2YFkIqOg80Q3PBIaDfVkasHak=; b=CPklvSRH6FY2ROW3tLcAiXPaODMbX2j6UW9WUZB3ijidpK7zYAKPjX306ZPVtNQxnk jxPc6+dp/7hFOZaQOhzGLawa/4gzZcYDyqaWW+mKvyx11FANaP3Qsfk2Og7v4MaAjX1N FCWQKA3+RP1u123O7bZdl71GyFX5o6a81YXbgHls2TadwHnQKMSg9TUPHl1RiCcxhAjV mfLJXwG0/jWcDrVyNEiZIKpb0tV8yNSbeXez68zKdFU/iuNUJKvvMdGSUyR69krwAFqf uuanwv45NUHQfI+LaMYmFHJKKlSXcTWlIQ6TC4YCUSTSEWeNt1gOVh4wD5B3I4T384MD rUrQ== X-Gm-Message-State: AOAM5311ZsjZytg9zY8owk9jBjiI4kgEdP9s4eXDlOP12bap7GYR9NVP BmGSQeiESIGnVDU+Z9qSAb2tne8OuLCYfJDIEjDH5s5w01tIDg== X-Google-Smtp-Source: ABdhPJzkip72V8LABmx6EPMD8b01qA1Re5bFWe9dRlqdkYizAM4JY2Muw4KpjAPPHCqIw7TbaxQd6rbcI0JwNdtIZuI= X-Received: by 2002:a05:6808:117:: with SMTP id b23mr22765627oie.7.1620752369053; Tue, 11 May 2021 09:59:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 11 May 2021 17:59:18 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="00000000000039f40a05c210d1cc" Subject: Re: [PHP-DEV] [RFC] Partial function application From: davidgebler@gmail.com (David Gebler) --00000000000039f40a05c210d1cc Content-Type: text/plain; charset="UTF-8" On Tue, May 11, 2021 at 4:39 PM Larry Garfield wrote: > It looks like the conversation has died down, and it's been two weeks, so > pending any other notable feedback I'll open a vote on this RFC on Thursday > or Friday. > > --Larry Garfield > > > My only query / point of consideration is a very minor one for what is otherwise an enthusiastic (non-voting) +1. In relation to one of the examples: function whole($one, $two) { /* ... */ } // equivalent to calling whole(1, 2, 3) $result = whole(?, 2)(1, 3); Is there a risk this has the potential to be confusing? We've always had this quirk in PHP of being able to pass extra unspecified parameters in function calls, but with the exception of variadic functions the expectation is that they are ignored. Arguably if I saw this: function whole($one, $two) { /* ... */ } $partial = whole(?, 2); $result = partial(1, 3); I might expect it to semantically translate to: function partial($one) { return whole($one, 2); } with the extra parameter, 3, ignored as per convention for any other function receiving undefined extra params. But the RFC says this parameter would be passed to whole(). Which is not unreasonable, but yeah I guess it strikes me it's kind of a quirk in itself to do it that way. -Dave --00000000000039f40a05c210d1cc--