Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114151 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20831 invoked from network); 25 Apr 2021 16:23:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Apr 2021 16:23:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 10F821804CC for ; Sun, 25 Apr 2021 09:27:37 -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 wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 25 Apr 2021 09:27:36 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 05D73179D for ; Sun, 25 Apr 2021 12:27:35 -0400 (EDT) Received: from imap8 ([10.202.2.58]) by compute4.internal (MEProxy); Sun, 25 Apr 2021 12:27:36 -0400 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=EUVtbCS8JwqW5E1wg8QYoQJu/pvwmmgTIj6CUSDRU Qo=; b=pW1Gr+CesJ5v0A2cpQJOxJQvUioCcxj4oSoALUrf+FKwd13VmY8yaQLHn noN4m5Erg3+JMFvvyYkv7RRK+0X4pGmW+B0OsFbramAFDsxP20unSe0G63k+J98V 5t8Nd4HX50Y6v4f8PCVLcHt/GJgBz2qkdvHE9ZpSonJrWbd9FKr+mvc3MvbitVEl wj1Cql3nmwr9ZriSz58AoIAGxUCIkpgH/l01VHwHY0IfIXPRpji7oK4S2SAc7piq HjPgPBqFnFPqu8LTCRREYLJ7lF2s4RQZH8h37m0q9nT/j4eLO27Zj2fK6nLSLIdM hFRyxTuVs1Uu3SufRSEz05asnpGIQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdduiedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdfn rghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrd gtohhmqeenucggtffrrghtthgvrhhnpeegfeevvefgkeekkedtteeiheeiudeileehhedu ffetfeekffefleffteelueejteenucffohhmrghinhepshhtrggtkhgvgigthhgrnhhgvg drtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 716213A02D2; Sun, 25 Apr 2021 12:27:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-403-gbc3c488b23-fm-20210419.005-gbc3c488b Mime-Version: 1.0 Message-ID: <255e809d-a70e-4524-8aab-8e7ebac7971a@www.fastmail.com> In-Reply-To: References: <5b9f1500-615a-48f1-815f-1d48b327ef90@processus.org> <179049b1475.11134368b213512.254739612773841999@void.tn> Date: Sun, 25 Apr 2021 11:27:14 -0500 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC][Draft] Sealed Classes From: larry@garfieldtech.com ("Larry Garfield") On Sun, Apr 25, 2021, at 2:04 AM, Olle H=C3=A4rstedt wrote: > > A total function is a function that is defined over the entire domai= n of its > > inputs. For example, addition is a total function over integers, be= cause > > for every possible pair of integers you pass to it there is a logica= l return > > value. However, square root is not a total function over integers b= ecause > > there are some integers you pass it for which there is not represent= able > > return value. (Negative numbers, unless you get into imaginary numb= ers > > which PHP doesn't support.) In those cases, you have to throw an ex= ception > > or return an error code or similar. >=20 > Maybe nitpicking, but PHP-land shouldn't make up their own > definitions: "A total function is a function that is defined for all > possible values of its input. That is, it terminates and returns a > value."=20 > https://softwareengineering.stackexchange.com/questions/334874/in-the-= context-of-functional-programming-what-are-total-functions-and-partia >=20 > Which means a total function is guaranteed to not have any errors, > like exceptions or division by zero. Compare with languages F* or Koka= > which support this notation. That... is literally what I said. There was no making up definitions. = I was using the actual mathematical definition. PHP is quite capable of= having total functions, they're a good thing, and we should try to enco= urage them where feasible. --Larry Garfield