From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Alexandrov Newsgroups: gmane.emacs.bugs Subject: bug#42644: 28.0.50; Please let max and min accept zero arguments Date: Sun, 02 Aug 2020 09:43:25 +0300 Message-ID: References: <87tuxmkhd9.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21596"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 42644@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 02 08:44:45 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k27jg-0005UZ-30 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Aug 2020 08:44:44 +0200 Original-Received: from localhost ([::1]:42582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k27je-0000cB-Ex for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Aug 2020 02:44:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k27j0-0000bl-DT for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 02:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k27j0-0005N6-1d for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 02:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k27j0-0001Uk-0M for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 02:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Alexandrov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Aug 2020 06:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42644 X-GNU-PR-Package: emacs Original-Received: via spool by 42644-submit@debbugs.gnu.org id=B42644.15963506165704 (code B ref 42644); Sun, 02 Aug 2020 06:44:01 +0000 Original-Received: (at 42644) by debbugs.gnu.org; 2 Aug 2020 06:43:36 +0000 Original-Received: from localhost ([127.0.0.1]:41519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k27ia-0001Tw-84 for submit@debbugs.gnu.org; Sun, 02 Aug 2020 02:43:36 -0400 Original-Received: from relay-1.mailobj.net ([213.182.54.6]:43801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k27iY-0001Tg-1t for 42644@debbugs.gnu.org; Sun, 02 Aug 2020 02:43:35 -0400 Original-Received: from v-1c.localdomain (unknown [192.168.90.161]) by relay-1.mailobj.net (Postfix) with SMTP id CC46611EB; Sun, 2 Aug 2020 08:43:27 +0200 (CEST) Original-Received: by mail-1.net-c.com [213.182.54.15] with ESMTP Sun, 2 Aug 2020 08:43:27 +0200 (CEST) X-EA-Auth: 2mCdtCX4inYzW6H0uxmTYa+8YXjLCkYeMH11D8i6KvWeQzL6X/3TNmig1v/dl2iCX44COzBhdx5UOgmujvCFLrCQ2KTv3eCa In-Reply-To: <87tuxmkhd9.fsf@web.de> (Michael Heerdegen's message of "Sat, 01 Aug 2020 08:30:42 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:183812 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Michael Heerdegen wrote: > I want to suggest to make the functions `max' and `min' accept zero > arguments, with > > (max) =3D> negative infinity > (min) =3D> positive infinity > > That would be mathematically consistent For _current_ their implementation. As you know, like most functions that operate on numbers, =E2=80=98min=E2= =80=99 and =E2=80=98max=E2=80=99 really accept _different_ types of objects= : integers =E2=80=98fixnums=E2=80=99, IEEE-754 inexact numbers =E2=80=98flo= nums=E2=80=99, and context-aware buffer positions =E2=80=98markers=E2=80=99= . Return value is coerced to the type that is sort of common denominator o= f types of arguments. But what should be used if there are none? Whatever= can be the most minimal / maximal now? But once upon a time Emacs did not support flonums at all, so using that ru= le the choice for an identity value for =E2=80=98min=E2=80=99 (if we reject= the idea to return some marker in some buffer as an absurd) was most-posit= ive-fixnum. Note, how this is unlike choosing that (+) =E2=87=92 0 and (*) =E2=87=92 1,= than 0.0 and 1.0 resp., because (=3D 0 0.0) and (=3D 1 1.0) while, of cour= se, (/=3D +1.0e+INF most-positive-fixnum). And imagine what a mess it woul= d be, if someone indeed had done this? In short, I believe, other languages (including kindred ones: Scheme and Co= mmon Lisp) are absolutely right in treating (max) and (min) as errors. > and would offer an easier to remember syntax to specify the infinities (a= t least for mathematicians). I hate the read syntax suggested in the manua= l, I have to look it up every single time. What reader syntax would you prefer? If Scheme=CA=BCs +inf.0 and -inf.0, t= hen note, that they are valid symbols in Elisp. That is, you can perfectly= do: (defconst +inf.0 +1.0e+INF) (defconst -inf.0 -1.0e+INF) > (at least for mathematicians) As for that regard, what=CA=BCs wrong with, (/ +1.0 0) and (/ -1.0 0)? BTW, I am surprised to hear, that IEEE-754-infinities are so much used in E= lisp. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIMEARYIACsWIQRSX35grYEsI2F1K7TIsPhUjufz5wUCXyZgjQ0cZGFnQGdudWku b3JnAAoJEMiw+FSO5/PnOasA/i/y4vL2et9sQ7Lo/bNWb2Hd9xUkzAgEnhJ5t5Re WkCSAP46xPtZp4sX83qhyOy+DZXYBhqP/JLWS0AMXQmImTfuBw== =q/cS -----END PGP SIGNATURE----- --=-=-=--