Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114143 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 78078 invoked from network); 25 Apr 2021 07:00:31 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Apr 2021 07:00:31 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 81DC31804DD for ; Sun, 25 Apr 2021 00:04:12 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 ; Sun, 25 Apr 2021 00:04:11 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id u20so60341936lja.13 for ; Sun, 25 Apr 2021 00:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Q8xLbOsv4zx4W/wtKwhIxeoPCSr0daBzmLWkOtmuRRs=; b=FT73Hq9qPU9ONmnWlrNnltX6E2KPh5Wp8qCHDSP9rYPGj3z3JOSfLF3QxArOE9DO3x g9e0CxldguceAxr4KM3BDcinlBSmU9wzu3bOehkUZGc7Bs8mKc+ve8WOPArEL2/NX5f4 PrkWPookZzjRKcicX6C6kYbtB3IhE9xR2tJ0fHRDf3S/UXYauAHpkSk8G7/Lf3rxXIdH cKE96YcB13dBPHBXPsIHEPRPdMPFHSeL9YrwzjretVvawIjaQTa0cY2ZIXqkgL47NyXc 4EeuZiYRqkbPor6lxpgkioOnKOkwQ8tPGU1yjXvtzCeKpE9Ht/2TB2DGxvDS2VTV/FGr 8XBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Q8xLbOsv4zx4W/wtKwhIxeoPCSr0daBzmLWkOtmuRRs=; b=lfviF9ZuDUtX5Df6t6i+K1u55lIa88V0dMkXqZblQNW7+fRXoXOrjjTu941AKaINkA jo+gSZgHDz5VBpWzpY0Q3IrIYP6DBZV/jazYH7Mxe+XH8GZsqwrrapOG/5LmW4V2LfQO GbF37EQXUAf3C4e81bjTPCP/5Ig/o0lg5VOzdCk3zzKdLrCzfnfZazXmu6n1k2//2bfA TslrqpbCb3ZTpVdC+MuGw7IPacupe30YeJtCeS6Kq6NRn9BfYjuhW1cVq/C8Pc1p2oZm WAFRzwbb/FS/YO1cbUqNMLsJ6FSHvxVyfi+3WpdmTUjiLbdufdnnSQdB5B1qfz4X3zV3 PsqQ== X-Gm-Message-State: AOAM533mgIunEWaTu3+m7NplzMUs7HLk6Drpwfmeqy70v8uz7o2DNsIT w3Cp4rWsz7k+zdpjHeo9JWqWEZTCu4bcuHy+y6pKVDWZ X-Google-Smtp-Source: ABdhPJwo+bQY9IFYZHnXjqnWYoRZQ07LT04GAFTjufjHpoLaEOJoqqHT2kqegmjL6FQqjrlT6RX7UQb0p/boHZ+6XVw= X-Received: by 2002:a2e:8650:: with SMTP id i16mr8478436ljj.175.1619334247837; Sun, 25 Apr 2021 00:04:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab3:4e13:0:0:0:0:0 with HTTP; Sun, 25 Apr 2021 00:04:06 -0700 (PDT) In-Reply-To: References: <5b9f1500-615a-48f1-815f-1d48b327ef90@processus.org> <179049b1475.11134368b213512.254739612773841999@void.tn> Date: Sun, 25 Apr 2021 09:04:06 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC][Draft] Sealed Classes From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) > A total function is a function that is defined over the entire domain of its > inputs. For example, addition is a total function over integers, because > for every possible pair of integers you pass to it there is a logical return > value. However, square root is not a total function over integers because > there are some integers you pass it for which there is not representable > return value. (Negative numbers, unless you get into imaginary numbers > which PHP doesn't support.) In those cases, you have to throw an exception > or return an error code or similar. 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." https://softwareengineering.stackexchange.com/questions/334874/in-the-context-of-functional-programming-what-are-total-functions-and-partia 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. I get your point tho. :) Olle