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: Mon, 09 Jul 2018 16:15:52 -0400 Message-ID: References: <29f933ac-a6bf-8742-66a7-0a9d6d3e5a88@disroot.org> <83bmecy6fx.fsf@gnu.org> <0d3175d8-d996-651e-b221-71978bde3a65@cs.ucla.edu> <87tvpdnzgy.fsf@tromey.com> <4c2a814f-c254-29e5-39cf-11b5f2e5c9c8@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1531167280 12643 195.159.176.226 (9 Jul 2018 20:14:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Jul 2018 20:14:40 +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 Mon Jul 09 22:14:36 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 1fccYO-0003CQ-BD for ged-emacs-devel@m.gmane.org; Mon, 09 Jul 2018 22:14:36 +0200 Original-Received: from localhost ([::1]:44214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fccaV-0004zx-EW for ged-emacs-devel@m.gmane.org; Mon, 09 Jul 2018 16:16:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fccZt-0004zf-IX for emacs-devel@gnu.org; Mon, 09 Jul 2018 16:16:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fccZo-00064U-KG for emacs-devel@gnu.org; Mon, 09 Jul 2018 16:16:09 -0400 Original-Received: from [195.159.176.226] (port=36419 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fccZo-00064I-CR for emacs-devel@gnu.org; Mon, 09 Jul 2018 16:16:04 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fccXe-0002L2-Cy for emacs-devel@gnu.org; Mon, 09 Jul 2018 22:13:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:Z+xdnXQHS8rFJ3Uz1nKnVUlhvMo= 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:227180 Archived-At: >> 2. What is (type-of 5)? Right now 'integer, but arguably perhaps >> 'fixnum is correct. Gerd's branch did this. > 'integer', for the same reason that (type-of 5) doesn't return > 'natnum'. fixnum and natnum are both subtypes of integer, and the basic type > is integer. The other ways of doing this would cause more trouble to > user code. I think it'd be wrong for (type-of 5) to return the same value as (type-of ), especially as long as `eq` doesn't treat bignum the same as fixnums. Also, for purposes of cl-generic's dispatch it'd be better for type-of to return `natnum` or `fixnum` when applicable. Grepping through Elisp code, `type-of` is very rarely used and it's even more rare for those uses to depend on the value returned for small integers, but I did find a few such cases, so it's indeed safer to just keep returning `integer` for small integers (and probably some other value for bignums, such as `bignum`). Stefan