From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Using the GNU GMP Library for Bignums in Emacs Date: Wed, 25 Apr 2018 23:33:50 -0400 Message-ID: References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <83bmecy6fx.fsf@gnu.org> <0d3175d8-d996-651e-b221-71978bde3a65@cs.ucla.edu> <51e619e0-ee38-eb97-6c1d-0925b675290a@disroot.org> <55c1e23c-1b9d-1a95-c683-5bf453967c51@cs.ucla.edu> <87o9i67j1o.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1524713559 18588 195.159.176.226 (26 Apr 2018 03:32:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 26 Apr 2018 03:32:39 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 26 05:32:35 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 1fBXe4-0004hk-QA for ged-emacs-devel@m.gmane.org; Thu, 26 Apr 2018 05:32:32 +0200 Original-Received: from localhost ([::1]:40140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBXgB-0000IS-Kp for ged-emacs-devel@m.gmane.org; Wed, 25 Apr 2018 23:34:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBXfW-0000IC-Nt for emacs-devel@gnu.org; Wed, 25 Apr 2018 23:34:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBXfT-0003q8-LX for emacs-devel@gnu.org; Wed, 25 Apr 2018 23:34:02 -0400 Original-Received: from [195.159.176.226] (port=50855 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBXfT-0003pt-EQ for emacs-devel@gnu.org; Wed, 25 Apr 2018 23:33:59 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fBXdK-0003m3-3M for emacs-devel@gnu.org; Thu, 26 Apr 2018 05:31:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:wDwtVSdKGI9sL29AS691v55sSwQ= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:224898 Archived-At: > Paul> And it depends on what we mean by "unsafe". Is it safe to assume that > Paul> (eq (1+ 0) 1) returns t, for example? The Scheme standard says "no" > Paul> but we might decide that 'eq' should "work" for fixnums in Emacs > Paul> Lisp. That sort of thing. > I would like the "egal" idea to be at least considered: that is, for > immutable objects like bignums (and floats), have "eq" do a value > comparison, not an identity comparison. Ideally we could dispense with > eql entirely. I think I agree, tho I'd describe it differently: the way `eq` is defined in Common-Lisp, I believe it is valid to make it an alias for `eql`. I think Emacs should move in this direction: define `eq` to be the same as `eql`, then check every use of EQ in the C code to see if it will necessarily behave identically to "EQL" and where it doesn't, replace it with EQL. Obviously, this will cost us some code size and performance, so we'd also want to try and measure the cost to make sure it's not too serious. Stefan