Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114190 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61168 invoked from network); 26 Apr 2021 14:12:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Apr 2021 14:12:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 41DF51804DF for ; Mon, 26 Apr 2021 07:16:39 -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,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-f172.google.com (mail-yb1-f172.google.com [209.85.219.172]) (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 ; Mon, 26 Apr 2021 07:16:38 -0700 (PDT) Received: by mail-yb1-f172.google.com with SMTP id 82so65044486yby.7 for ; Mon, 26 Apr 2021 07:16:38 -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=Mb2Juk71/h1T/jqWYkhr8eVXFHrXxb4cU+33FfdUNRY=; b=J8sFlGbr0IKofnNE4CqQiw9Beqn+UnqgcQP2NnlsZLL7GI1pYVngJj0c87AjgIcVwf h9Uh3IVZ9pnTXACf+RJyDK0kzmm85j+60/NtfpzKYfPnQijLO0mFkQEqf8TYKZFZ8nCV yExHkIhhtW4WOunNiZLhUTHQbbiV/dDzR0Bbg= 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=Mb2Juk71/h1T/jqWYkhr8eVXFHrXxb4cU+33FfdUNRY=; b=M8QRRVjZpsxuI4+IazYJv4tOZ7F4HxS9hrpRkqu5E4PljTkJk0oK05FpOpJtc9THnp 8g9kCxZmWLd4tviWxla9ggt5iH4aOhUdgiIYRGE90Fznk29DoOMfl1PDe25fmWNrHTxk 2OT8YWKeHphJhjVc+ozPGa8evhokgCre1WPZ8ORqmU/+U2xmj6xMj/5KUDzMsVoEAqYf AyzhiJ+RYBQpxOQGx7E4I6rwt8IGqT2+vN09BzvNcvP2+AjjlEPnpViT5FTUN3fPxoYV v6vV7BKQBoFu2egCuTHtjtvmLv1Pcwt0eTLgA/uhX8NoXmKGIjU8IEkF8aXtdLzYZLFq IRHA== X-Gm-Message-State: AOAM530/ANxJa0YFCba/VdGGCSZ1OY142Ct0p6KT6It6rj2kBRhOX3R+ yey+6CyLmtoc2odRENzDcWRGC/DvqbjW6JcSmmbVcA== X-Google-Smtp-Source: ABdhPJz9JBOeSkphDD3NmizDdBm1oskrBAQVFwTVBWB6rmX/zuusGxbHcOqAQ/2ot7kWQlK3VvXYrKlH+5C27MKoc4w= X-Received: by 2002:a25:35d4:: with SMTP id c203mr25390796yba.450.1619446597212; Mon, 26 Apr 2021 07:16:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Mon, 26 Apr 2021 08:16:26 -0600 Message-ID: To: =?UTF-8?Q?Olle_H=C3=A4rstedt?= Cc: Larry Garfield , php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Partial function application From: internals@lists.php.net ("Levi Morrison via internals") On Sun, Apr 25, 2021 at 1:51 PM Olle H=C3=A4rstedt = wrote: > > 2021-04-25 21:25 GMT+02:00, Larry Garfield : > > 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 bi= ts, > > and general instigator/nudge. :-) > > > > Discuss. > > > > -- > > Larry Garfield > > larry@garfieldtech.com > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: https://www.php.net/unsub.php > > > > > > Nice. :) Are there any other motivating use-cases besides pipe > operator (that are relevant for web dev)? > > Olle > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > Yes, of course! PHP has many uses of `array_map`, `array_filter`, etc, that take a callback as a parameter. It's hard to create good examples on the spot, but here's an example, at least: array_filter($array, in_array(?, $haystack, strict: true))