Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114513 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 681 invoked from network); 18 May 2021 13:35:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 May 2021 13:35:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CE8CE18053C for ; Tue, 18 May 2021 06:45:13 -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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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, 18 May 2021 06:45:13 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id DDED712E7 for ; Tue, 18 May 2021 09:45:11 -0400 (EDT) Received: from imap8 ([10.202.2.58]) by compute5.internal (MEProxy); Tue, 18 May 2021 09:45:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=I7Bbf+ VJeT100V4GuePu/w8Z2sudv1RIpZyrdzw2PGY=; b=jDE9pQP4rJ3A5BmOhw9wpV 5L4zcXVeb2U0omJ900SAb4DTaXDv0C/aCp4tR2a6mboMVbysdVaeQI1vQ52u/YJT KSG4Wg12g/TgAj7TONLxKOaS2uEjHtyMFAxt35gYDMudljAlxYslugzbnlqePiXw O5tWtXr4qgBf76wwAI1dAXlD5lpj5OLLL5DkwfBxE8mbfcPcPo1mKSwnh5062UyV 4IQiBddTtchpD2Q9IZF/IEQUCZ+zOY1R72o30OwqVUN2qHIpP5UGnaZW0qNP8zCU g5SXwZ6S6Rtrw5Ih4sllCpyviGkQlfZ+foWO2ddD5YR6i9gcACBmEMpqTDbvucAg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeijedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeejueeuudeiheelkeefjeehfffgieegteetgffhleeg gffggfeifeetvddttdelkeenucffohhmrghinheprghrghhsrdhfohhopdgrrhhgrdhfoh hopdhplhgrtggvhhholhguvghrrdhfohhopdhunhgrmhgsihhguhhouhhsrdhfohhonecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhi esghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2AE9F3A0130; Tue, 18 May 2021 09:45:11 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-ID: <9c83ba12-79e1-4fc6-9a75-7a6b04965f03@www.fastmail.com> In-Reply-To: References: <1565EB81-57B7-49B0-A47C-342E0088A432@trowski.com> <532D1413-52FF-4403-A20B-BBDB51163C85@trowski.com> Date: Tue, 18 May 2021 08:44:39 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] Partial function application From: larry@garfieldtech.com ("Larry Garfield") On Mon, May 17, 2021, at 11:14 PM, Paul Crovella wrote: > On Fri, May 14, 2021 at 4:44 PM Aaron Piotrowski wrote: > > > > My issue is the dual-meaning of ? in the current proposal. In `foo(?, 42)`, the ? represents a single argument, but adding a trailing ? (such as in `foo(?, 42, ?)`) represents any number of arguments. Would it perhaps make sense to make superfluous ? markers an error? > > > > foo(?); // Fine, needed to define a partial with no bound args. > > foo(?, 42); // Ok, binds second arg. > > foo(?, ?, 42); // Ok, binds third arg. > > foo(?, 42, ?); // Error, unnecessary placeholder. > > foo(?, ?); // Error, unnecessary placeholder. > > > > The intention here is to keep the syntax unambiguous. > > > > foo(?) == foo(?, ?) == foo(?, ?, ?) and so forth is not going to be obvious to everyone, so why allow meaningless and misleading syntax. > > > > Cheers, > > Aaron Piotrowski > > > > While it's my preference not to use superfluous placeholders they do > no real harm and I do not feel comfortable imposing this preference on > others. User-space functions have always accepted more arguments than they're defined with. They just get dropped off the end silently, unless you use func_get_args() or variadics. While I know not everyone likes that "feature", it means that extra trailing ? "arguments" don't feel weird to me. They just get dropped off the end and we move on with life. At least that's how I conceptualize them. --Larry Garfield