Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108552 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4176 invoked from network); 13 Feb 2020 23:41:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Feb 2020 23:41:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BCED31804D7 for ; Thu, 13 Feb 2020 13:55:42 -0800 (PST) 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,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE,SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 Feb 2020 13:55:41 -0800 (PST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id C0CBBE3E for ; Thu, 13 Feb 2020 16:55:40 -0500 (EST) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Thu, 13 Feb 2020 16:55:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding: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=yZHTcKNwnyhM0WGCcFR5Lq4MJTmjQAZWSguSxfyG0 EQ=; b=mpyXp/awvlmYWq3i7Uw41YwlFyjOQO3ZmJK4xIG3L7pzA8jwnexGDml/0 Sk062kwi1XqvbzRCkGbbr+pjZuuhYKLWy58GPt7P0eADYKbN0a2c9QzrOFy0YLF2 RKJTBOpcR329VTtucMAS9L+iaN9hBpjq7Hq/Tbrbht/YHyV+jkQ3ibceVwaRAI0o UZ6nzTqBS2lhG+vxxc8OpyLmOaiOn7PIBeIXNsaU+7zRGT3FUDXnGQOcnvuIdhLQ EQsVN82lQsp5kSr+8jI1P9lTl9cxYIO09/vEvYrPNwuCcttrP/k22bqeyytq38fd lF+I6EwTFUz9lk9nxsdg3RjTE/bJw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrieekgdduheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep lhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id DDBB414200A2; Thu, 13 Feb 2020 16:55:39 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-802-g7a41c81-fmstable-20200203v1 Mime-Version: 1.0 Message-ID: <53f3c75f-d79f-4029-9b43-4d6087ac3195@www.fastmail.com> In-Reply-To: <8D1FD9A3-C0F0-4B70-8D6C-F85275E4D367@newclarity.net> References: <10FCCCED-B8AE-4394-91B3-0FEB448E2398@gmail.com> <2C404984-AD76-4CDF-8E1A-04DF8EF024DD@newclarity.net> <8D1FD9A3-C0F0-4B70-8D6C-F85275E4D367@newclarity.net> Date: Thu, 13 Feb 2020 15:55:19 -0600 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] From: larry@garfieldtech.com ("Larry Garfield") On Thu, Feb 13, 2020, at 2:12 PM, Mike Schinkel wrote: > > On Feb 13, 2020, at 1:48 PM, Larry Garfield = wrote: > >> But since I seem to be in the minority of caring about the name, le= t me=20 > >> propose the following which was influenced by Larry Garfield's most= =20 > >> recent post. Since it seems that people want the convenience of a=20= > >> short notation to get a closure, how about this: > >>=20 > >> function foo{} > >>=20 > >> foo::function =E2=80=94 Returns name of function > >> foo::fn =E2=80=94 Returns closure for function=20 > >>=20 > >> Since using `fn` creates anonymous function closures it kinda makes= =20 > >> sense that `::fn` would return a closure. > >>=20 > >> -Mike > >=20 > > thinking-face-emoji.gif. I could be convinced of that. It seems li= ke "both" is a possible solution, but my concern would be someone using = one of them in a case where either works, inadvertently, when the callee= is expecting just one. Eg, getting into the habit of using foo::fn, an= d then using it on a builder routine that chokes "later" when it tries t= o serialize something. >=20 > True.=20 >=20 > But it would be a really high bar to say we can only add new features=20= > if we can completely protect the developer from themselves. At some=20= > point we have to assume programmers are adults, or at least can take=20= > responsibility for learning how the language works.=20 Strawman argument. Nothing can "completely" protect developers from the= mselves; not even Rust. :-) But features should still be designed in su= ch a way as to be hard to screw up. Not impossible, hard. The question I pose is whether "both" would be "hard enough" to get wron= g that it's not going to cause more confusion than it solves. I don't k= now the answer to that question. --Larry Garfield