Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114484 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 59341 invoked from network); 15 May 2021 04:25:20 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 May 2021 04:25:20 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DE7E11804E3 for ; Fri, 14 May 2021 21:34:01 -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-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.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 ; Fri, 14 May 2021 21:34:01 -0700 (PDT) Received: by mail-pj1-f52.google.com with SMTP id t11so872549pjm.0 for ; Fri, 14 May 2021 21:34:01 -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=7hYEOtzgtvRSMOTjhLURR4tQ6Z2lgRmdKkUDsMY8RDk=; b=dK2y/ICa1lCRhx9EYIxxIGUInPRkWoZqUQEbgNCIBFWahDZrA/ua1lsMSDglr2lgvw upPMpQP8qQp5zKgDSnHRCLiYTHmsWhuUQiUNh9zzgB11c2smT9+LdpsxCoFC+MxaRV6N JvaI3B0Tzp+pAdkZxXFdBr+AUcOgZhJsq2pc97LgM0Q2jZm29APQg/Iq8xeg2yze9M7H Se0EWiMDQPheUg08C6EBxsWVMEXgtmDuT5wTpL6igS5H3RKfn0cpXGfjaa6ENT4yK8YO Lytb+1rnZot2qQ0+XrzcQ1rZJcY5CF1gHB+ZHhwoZozYz5x5cjGiVOJa9R8AgOq90HSc LJqw== 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=7hYEOtzgtvRSMOTjhLURR4tQ6Z2lgRmdKkUDsMY8RDk=; b=YZDMKmwp1cu9rz4qTpOYQAZIDErdhlTMVOi2HyV76TombTVIQVu5M2Fz7WP2WIY7i6 xV4TZ/UBL2IyvR84mdXoPe2JYA1YyzpGts+1FVJzMedCmugmutgShP/8cI9UqUNUR0v+ JZnk3mFFctgiViZUOE9x84NyKNKDZRMyoakL6m2JdYkZp9oA6j3ibQWIfFVsamAg3a3Z bgiOeepWrW4YC9GbV3bdvrp6fUtC82QNwYaBom1feNtpmONjI8DZEsXIw7pX+roznGJ9 k2Zf+pvJoKBwipwnt14K1Wg1FhX3IVVgRh99JSEzEvonaWtl9j2ft0MjBzMv/B0uy8SR cDiw== X-Gm-Message-State: AOAM53003iAH2ZI9WQIFP8CPeRv9xDj/+v+gHcbtl+wRbfIC6vyjP/mv D28Isp4HpZaqKnPdNJNpVwHOlVs6jWh2IiNCEgE= X-Google-Smtp-Source: ABdhPJyM1secrPXwxbnwU/jc3WFkKKe1BK+dax02OKppgx76ZZxQGn5s3XzDujkHuTI0oMUSZcPXnHGQWN0gPmeFz2c= X-Received: by 2002:a17:90a:b38a:: with SMTP id e10mr56429307pjr.175.1621053237449; Fri, 14 May 2021 21:33:57 -0700 (PDT) MIME-Version: 1.0 References: <1565EB81-57B7-49B0-A47C-342E0088A432@trowski.com> In-Reply-To: Date: Sat, 15 May 2021 09:03:22 +0430 Message-ID: To: Paul Crovella Cc: Aaron Piotrowski , Mark Randall , php internals Content-Type: multipart/alternative; boundary="00000000000061581705c256de91" Subject: Re: [PHP-DEV] [RFC] Partial function application From: hossein.baghayi@gmail.com (Hossein Baghayi) --00000000000061581705c256de91 Content-Type: text/plain; charset="UTF-8" > Requiring additional trailing argument placeholders or adding an > additional token `...?` unnecessarily complicates things, burdens the > user, and only serves to further promote misunderstanding. > > Providing ? as a means of placeholder for some arguments and ignoring the rest could complicate the readability in my opinion. Maybe we should move (?) out of the arguments list as a means of creating a partial. What I realized is that we need a way of signaling partial function creation. Be it foo(?) or foo(?, ?, ?) or however many ? is added there, which does not convey any meaning and also doesn't produce any sort of error! Say instead of foo(?) we had ?foo(). Since we have named parameters it could help us in providing some of the arguments and deferring the rest. For instance: ``` function foo($x, $y, ...$z) {} ?foo(); // causes a partial ?foo(y: '..'); // also causes a partial ``` This way we wouldn't need to worry about the number of ? added to arguments list. It may also help in avoiding future PSRs in telling us how many ? we should put in there :) --00000000000061581705c256de91--