Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114501 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99580 invoked from network); 17 May 2021 15:07:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 May 2021 15:07:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0042F1804F8 for ; Mon, 17 May 2021 08:16:48 -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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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, 17 May 2021 08:16:47 -0700 (PDT) Received: by mail-qv1-f46.google.com with SMTP id c13so2079560qvx.5 for ; Mon, 17 May 2021 08:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=newclarity-net.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=IGbxBo4ONCoP1+t9CD6AW4zz07r6C+zcJ702stBRh/w=; b=Yf7mf9OhzWZ+19HGYMLrYQJCQoNb7DejSzYQ0etITFSP2jvRAUAuUEolajvBtSiKWX EOCF3pO4duWPzj4KGoP5R+uPe6AUsG8PB7VoJKWzZEs/0nE9dR+gYF4u475mI27Lf5EV VE0d+S0kfXeCFObMcXPdq5fMy9Z3m6r1em1k1I6P8+2qrrSTWqRBJDTqPwXJIPj92jYL F5uYXzTq1sXD+/pnIqZrt54BvE1BNMVWJWXREXn5J+BiSXHg9wpXo932Xa2lBniEOFkD XSPJhXaY3Rv/EGQUIBAN9rrBvdL8s+ff+J/rbwGzX6R7U135PO23EFOUhGqbF7t1m+P9 gEBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=IGbxBo4ONCoP1+t9CD6AW4zz07r6C+zcJ702stBRh/w=; b=Y6OelakdKDQwdp135xa8c6NyneWXEqF7FRCVjXeLv4jwhIQ6WsSTxRA1pJypsRQ/CG dc8HV/bhhBnYzBG6xWW24BV78yQEwXOs+CQtDItX/Dv1Iy9YNtsjuZVtxYsJKeFYsZPF e48nvdSsTOUpVIn/EOeAO1LIwbpbJJsNqwx2AEoR6UEd8KMDJ8FyKsuPHFFU0S8zUQFq PoMGLWxx9jPlhdZpminrmCa4ZCYlogdvmw5hj+8afL/KbeWqm791eb9EMxNVCm2NJ4AK 23UhKJPHMiR8uRvPLgf2cPvUfWLEMcSpicjkFwzCmOVx1ueTD09eMMyaFXT5pl+O4+nt OCRA== X-Gm-Message-State: AOAM531p8JIosycBN7VjSUIuG1Y57laKQCIN0BVq3d2ot9tzF/VP1Jmy xkYoI74gS7vSY0l8wHTnMzRL2A== X-Google-Smtp-Source: ABdhPJy8gWR8zT9RylQczl6fAw1/EOPyXNXXclkEXCFXfEtSkQnXrIuX5sWJ4RqOKKpUvmUi6D3/tQ== X-Received: by 2002:a0c:e643:: with SMTP id c3mr141048qvn.18.1621264606883; Mon, 17 May 2021 08:16:46 -0700 (PDT) Received: from [192.168.1.10] (c-24-98-254-8.hsd1.ga.comcast.net. [24.98.254.8]) by smtp.gmail.com with ESMTPSA id v10sm10465466qtf.39.2021.05.17.08.16.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 May 2021 08:16:46 -0700 (PDT) Message-ID: <5B96C4C4-A324-4EF8-8196-83480E897884@newclarity.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_D0A00182-9156-4346-A3FE-8B28593D1C4B" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.6\)) Date: Mon, 17 May 2021 11:16:43 -0400 In-Reply-To: Cc: php internals To: Guilliam Xavier References: <1565EB81-57B7-49B0-A47C-342E0088A432@trowski.com> <09B663C3-E21D-432B-BB7F-78312F827C30@newclarity.net> X-Mailer: Apple Mail (2.3608.120.23.2.6) Subject: Re: [PHP-DEV] [RFC] Partial function application From: mike@newclarity.net (Mike Schinkel) --Apple-Mail=_D0A00182-9156-4346-A3FE-8B28593D1C4B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 17, 2021, at 10:50 AM, Guilliam Xavier = wrote: >=20 >=20 >=20 > On Mon, May 17, 2021 at 6:58 AM Mike Schinkel > wrote: > >=20 > > Well, I was thinking that by changing the proposed syntax we could = achieve > > what is proposed and a little bit more. > > Also we wouldn't need to worry about the number of ? needed as = arguments. > > Since all we need is to mark the return type as partial (closure) on = the > > fly and grab hold of what is passed as arguments. > >=20 > > There are some different syntaxes that come to my mind: > > We could still use ? but outside of the arguments list? > > ``` > > $partial =3D xyx?(..); > > $partial =3D ?xyx(..); > > ``` > > or maybe different symbols: > > ``` > > $partial =3D :xyz(..); > > ``` > >=20 > > We might be able to even cast the return type: > > ``` > > $partial =3D (?) xyz(..); > > $partial =3D (partial) xyz(..); > > $partial =3D (fn) xyz(..); > > ``` >=20 > Casting is another interesting approach that does feel more consistent = with the existing language. =20 >=20 > Since it *is* creating a closure, wouldn't this make the most sense? >=20 > $partial =3D (closure) abc(); >=20 > Ouch! definitely NOT! > =20 > $partial =3D (closure) xyz(?,24); Mind if I ask for you to elaborate on your aversion? =20 Asking for general understanding, not to debate the point. -Mike= --Apple-Mail=_D0A00182-9156-4346-A3FE-8B28593D1C4B--