Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114412 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97792 invoked from network); 11 May 2021 16:50:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 May 2021 16:50:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 67E701804E3 for ; Tue, 11 May 2021 09:58:00 -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_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (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:58:00 -0700 (PDT) Received: by mail-ej1-f52.google.com with SMTP id c22so2686522ejd.12 for ; Tue, 11 May 2021 09:58:00 -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=PSVE8h5/MlXpOJspS7e3fQllBDMKlje6IxF7GyPzR1o=; b=D7/o81zWO9PFbFGGlxC4lG9OUoykhSdQYs7/8pR55HIdyT8H1fEZ548WX249TcGi8k JZS35/+bL876V5rbw5w2rfZDzd7T0tNdxl6dPM0WcIc+a5ln9UGeY4/zCt6CG/iqpL0w oPy5h09QcDEU8pBuFy8dMjC6vxM3i5qoNeajJOyUC77iDGOl2ei7JpyRCAEMYyNmdlQ9 5fIcyANeF7bDsXBONQBDk+jyeluA3CUVEemKIJ2gIfojE7S4RXRMfMCto26ZEdI8ng2q 9qVMO2aUtha2Z4V/ul3dv5pxNnJwAlFgXqAyq8hPgwZG3TFx92m5p+r/nRrulC2DeHC1 TewA== 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=PSVE8h5/MlXpOJspS7e3fQllBDMKlje6IxF7GyPzR1o=; b=LhDaDk7JkZ1Kouw6rD4wO7flDOgtW5mMA2yTqe2dsuVgVAu8X8ZnoQ7DsjEwWkqnhe oi3+bmfujHMRme8MaNQRCxJmB16Km9z+NXQTpl+E2En9Szv5ZDQNk8enDXYMY85IL14o y5eSnU5XZRdtRRPpa31UZFHoP5b9nxHmospzj2VukXfxfhHf4Oxa0n1zvHxm7qPwAo1k wXmvI7d7ReqoLD5RZ479FuFigxuNmKDpHezhsBnjwxPAK6VzLUWb1qsO5Mluk5YTiRh1 wlk9ch1RiGmgMH9+vRA/BpcCfhkNH51e5unsu0cEz5AxCaYiKgdkZnF3MTYcAGrCKHtR X17g== X-Gm-Message-State: AOAM53023NNB4lA2CacE3ufdDvVgnDm4T4dVeRY4pdFY4wk6pphXYhSU 4bJ1X7ugp31peakx3o5BbDY/8HGxWuatNMUiy2fxeLNPZnE1CQ== X-Google-Smtp-Source: ABdhPJwnzLUq2g6R6Viz94viG7dAnvq/uQN4llubVR6TgA0qunrHR4+G09wOGpV6cpo7wdylEu/WgxYz36jN9JddTpk= X-Received: by 2002:a17:906:e08c:: with SMTP id gh12mr33637545ejb.115.1620752277428; Tue, 11 May 2021 09:57:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 11 May 2021 18:57:45 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000c3dc8b05c210cb4c" Subject: Re: [PHP-DEV] [RFC] Partial function application From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000c3dc8b05c210cb4c Content-Type: text/plain; charset="UTF-8" > On Sun, Apr 25, 2021, at 2:25 PM, Larry Garfield wrote: > > Greetings, Internalians! > > > > I would like to offer for your consideration another RFC, specifically > > syntax for partial function application. > > > > https://wiki.php.net/rfc/partial_function_application > > > > It includes an implementation by Joe Watkins that is already about 95% > > complete. (There's some edge cases he's still sorting out, but all of > > the typical cases should work already.) Most of the design work comes > > from Levi Morrison and Paul Crovella. I helped out with the tests, a > > few edge bits, and general instigator/nudge. :-) > > > > Discuss. > > 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 > LGTM, thanks for the RFC! What about visibility? I suppose this works even outside the object scope? should this be mentionned? $foo = $this->somePrivateMethod(1, ?) Would it make sense to support a way to use a placeholder for "all remaining args"? Eg: $foo = some_func(1, ...?) Combined with my previous comment, this could replace Closure::fromCallable() by a language construct, which is something that we already discussed in another thread (we talked about some ::function special suffix instead): $foo = $this->somePrivateMethod(...?) In this last form, we might make this result in Closure::fromCallable() exactly. Aka no increase of the depth of the stack trace. BTW, ideally, partial functions should not increase the depth of the stacktrace at all. Do they? Nicolas --000000000000c3dc8b05c210cb4c--