From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: Making 'eq' == 'eql' in bignum branch Date: Tue, 28 Aug 2018 22:57:50 +0000 Message-ID: References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <765767b2-d2e5-a9a6-f724-d58ecf4847bb@cs.ucla.edu> <76081b5d-8c10-0a37-2c97-d4864c0faa80@cs.ucla.edu> <09153aed-361d-4f82-d9ac-b502314769ae@cs.ucla.edu> <83lg91dqd4.fsf@gnu.org> <0F8F6E54-176C-48EE-9E7C-7CAC424D0D55@raeburn.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1535497044 31505 195.159.176.226 (28 Aug 2018 22:57:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Aug 2018 22:57:24 +0000 (UTC) Cc: emacs-devel@gnu.org To: cpitclaudel@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 29 00:57:20 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fumvI-00084v-AT for ged-emacs-devel@m.gmane.org; Wed, 29 Aug 2018 00:57:20 +0200 Original-Received: from localhost ([::1]:40358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fumxO-0003ho-O9 for ged-emacs-devel@m.gmane.org; Tue, 28 Aug 2018 18:59:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fumwp-0003hX-33 for emacs-devel@gnu.org; Tue, 28 Aug 2018 18:58:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fumwU-0004dr-87 for emacs-devel@gnu.org; Tue, 28 Aug 2018 18:58:47 -0400 Original-Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:44099) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fumwQ-0004WZ-1S for emacs-devel@gnu.org; Tue, 28 Aug 2018 18:58:33 -0400 Original-Received: by mail-lf1-x131.google.com with SMTP id g6-v6so2705134lfb.11 for ; Tue, 28 Aug 2018 15:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=i73ki7JRKgYjt7n30yCYMcGyUf+GK3N9oNNfTqIavbI=; b=TuoNkRKLHg99WUGKG/dx7MTRQD4by54TK2yxY+G+cvzY4LEXYyL+JmCj/AeNrbVAo6 x+Z070SICDSZCehCpAGuWLTy7bewp13hf+Pv9hNFLS5a9QoTlEuZhnsKdBjwDXk6Bq1g mavZY/UaYZ/4RzHz1M/yd+RyuGrDgiAQf0cUef7TouyS1fNjzFufTHHnUuUbrnMVQf9k rjwk8+jG4q0WRrCUWMx2RNeZt0vfotWkkqz1i1gLYuF8+ty4Rf2XK24vGN/ZaL9MaOpk qFrIbUvCRb+nTH+TBZq9x+EUVzv2T3/qOfO8q36rgxniB3nA1Ci7We3H2ZOePqW3kHbG Nu1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=i73ki7JRKgYjt7n30yCYMcGyUf+GK3N9oNNfTqIavbI=; b=GkpKIv3WCsp1TOtPZeTzBvAZxC01rSnWwkfspIraFKmZY+gG+wmHyDH9zB/nBSXEi7 wWgXEFo1L9AVkLymagyj4pp9g764PQsAEqckPCLm7wDO6Ce2yEIWQ3uK6pHoBg6M9LDn WqtaOENXPbFoX4aCIoVuv5/uMDFUr1cVS5i2is+8dM+T8FFA5Szz1A0vnmMWvjYv1hoq rCpMWn1uABTMuqHNJEt+XFlcClG/nTiT7zANjPIg3IKqdibURCaao1Th8yBt4QgPxpNC 4pwturhIUmrYxy94Do4onVzxKcZSCCHvEVKPpoHi+RbZBW4cTqhj2nSjYLFP6vlqBG4P yfmw== X-Gm-Message-State: APzg51D0m7dajcTmgwlT8XaJOERBJ/XSvBfYYbSBO8GY31Znup+UZX1h 4UbHyEobFpydJKf1soY6r/gF+an6lscl08UMt1Q= X-Google-Smtp-Source: ANB0Vdazfmg8zZt28MQmV6TLERJaBKhPtjfKEbXGUymbW5x2Jhxz098xPaGOm10FSrOQdqTycI23lztPReffxfzRHgw= X-Received: by 2002:a19:430d:: with SMTP id q13-v6mr2424751lfa.77.1535497108471; Tue, 28 Aug 2018 15:58:28 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::131 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229034 Archived-At: On Tue, Aug 28, 2018 at 6:19 PM Cl=C3=A9ment Pit-Claudel wrote: > > On 2018-08-28 08:15, Stefan Monnier wrote: > >> If =E2=80=9C1.0e+INF=E2=80=9D is hard to remember, how about defining = symbols =E2=80=9C+inifinity=E2=80=9D > > Pip's suggestion is to use (max) for that. > > I think you read Pip's suggestion backward: (max) would return -infinity,= not +infinity. (Which makes sense, since you want max to distribute over = list concatenation) > > FWIW, I'm not a fan of using either (min) or (max) to represent minus inf= inity; it looks a bit odd. Many other languages have an infinity constant = already, so that pattern is well established; making (max) an alias for eit= her of the infinities is prone to introducing confusion. It's more natural in code than it sounds at first: you use (min) when finding a minimum, (max) when finding a maximum. However, if there is a good name for it, an infinity constant is perfectly fine. Such a name should make clear that we're talking about a signed infinity, not one that makes 1/x continuous by adding a point at infinity to the real line. Signed infinities are convenient symbols, but they're not numbers; I recall the horrified reaction of a mathematician when I told her about IEEE infinities (she thought I was making it up about NaNs). I think it's all so confusing that it would be best to accept the slight performance cost of having a function like (defun minpair (alist) "Return an element of ALIST for which (cdr X) is minimal." ...) and using it consistently, in addition to defining (min), (max), defining a pair of infinity constants, making `min' and `max' ignore nil arguments, and changing `eq' to work on infinities. And maybe changing the read and print syntax for infinities.