Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114667 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 39202 invoked from network); 30 May 2021 02:31:40 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 30 May 2021 02:31:40 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 58F1E1804D9 for ; Sat, 29 May 2021 19:44:05 -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,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-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (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 ; Sat, 29 May 2021 19:44:04 -0700 (PDT) Received: by mail-yb1-f169.google.com with SMTP id e10so11370203ybb.7 for ; Sat, 29 May 2021 19:44:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=CgHxWZPH0RGNfy2MYTwA8QkBqtAa+dn0zP+vOyNP4jY=; b=V2c8xrzKtLuoDJCq29lfOY2V3gh9BLf9SrtugjmOPeVt96w/mRKvMuuokqilDzus0Z KmERTdkkWsi048ndLQhNiH7raqUcUDqMh8CjkqERbz3r7xG9cU4Uxuu96wDc8WjgGmYt +evMH36peXmjubHO4MVybWaWEjuiOii2yKtmw= 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:content-transfer-encoding; bh=CgHxWZPH0RGNfy2MYTwA8QkBqtAa+dn0zP+vOyNP4jY=; b=Fdn63v0Agehih3QkwaDTQ5N8doBlVUbjsa6vT8QOu3nuo8GHYi6qSG/Yr01haPOjbA onO4UnboXfDIm758p4yD2vt31Qar+h5GuqB2NNURcpSXWQtMHjmaOJCDQYcNYYcUIC/h Q7OFS5YNcl6T049GqjFgpz/Y9yG+m4ryXRAD7njGqgwUzarrI079QX7j7Y+iaZMVDf8e +lu5NKpZJQaIH+Oaf8BTxLGYyg+zO2/AhoaWNNjdod2ERa/x2mRQIMo61XPkOeyIB/Ea 2eH4yfFQOQGWHUSKgfG42nI2WT0pNiDA56bTnDZ+Bc+9hEVVFTJ29YZCjBDgbbCFzdMz OdJw== X-Gm-Message-State: AOAM533XUYzCC91GvcRc/hcBZaVmcYlCkmM+iM8T5pfbJfF7AWOz8alU UoI8CFZoyCPLNFnogl32JB40XWFJ94vNMm4zC064deSSxWcKsA== X-Google-Smtp-Source: ABdhPJy3ByYsj33UnHTpvGjmLY50lGemloCql+i9+TIpbw173SEuYzUlauYOfAcqmVvweNiXUfxSup5B+u0CefCC1rc= X-Received: by 2002:a25:bb84:: with SMTP id y4mr21231964ybg.450.1622342640880; Sat, 29 May 2021 19:44:00 -0700 (PDT) MIME-Version: 1.0 References: <60b2b70c.1c69fb81.dd8bc.e30aSMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: <60b2b70c.1c69fb81.dd8bc.e30aSMTPIN_ADDED_MISSING@mx.google.com> Reply-To: Levi Morrison Date: Sat, 29 May 2021 20:43:50 -0600 Message-ID: To: Mark Randall Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: [RFC] Partial function application From: internals@lists.php.net ("Levi Morrison via internals") On Sat, May 29, 2021 at 3:50 PM Mark Randall wrote: > > On 25/04/2021 20:25, Larry Garfield wrote: > > 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 Lev= i Morrison and Paul Crovella. I helped out with the tests, a few edge bits= , and general instigator/nudge. :-) > > > Can I be a little pushy and ask for a subvote on "..." vs "...?" > > It _probably_ won't matter, but with ... being used as the language's > universal variadic / unpack, we may use it for similar things in the > years to come, and I think it makes sense to pre-empt a potential > conflict or source of confusion down the line by using "...?". > > Just as a variadic function argument is ...$ a variadic partial closure > would be ...? > > I do not, at this time, have a firm example of where this might become a > problem, otherwise I would state it. The closest I can think of for now > is that it's entirely possible that auto-capturing multiline functions > may end up using: > > $x =3D function() use (...) { /* */ } > > Which could possibly be confusing. Not a definiative example by any > stretch, but but I do get the feeling that, as we can future proof it > for effectively zero cost, we should. > > Mark Randall I do like the symmetry: Positionals: f($x) --> f(?) Named: f(x: $x) --> f(x: ?) Variadic: f(...$args) --> f(...?) You are right that it _might_ be more future compatible. I don't care about the extra character in this case, as the char does add some visual cue: $callback =3D $serializer->pack(...); $callback =3D $serializer->pack(...?);