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: Tue, 10 Jul 2018 23:42:28 -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> <49d8ba62-c9a5-9203-d882-8e900b441ff3@cs.ucla.edu> <8e0320d9-e0d0-2b57-57cc-2df4399f133c@cs.ucla.edu> <87lgaio7xd.fsf@tromey.com> <9ee4b3c6-9d87-a8e6-7e07-455da91c8966@cs.ucla.edu> <75af00ba-3e41-7edb-2619-8311f912dfe2@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1531280477 19752 195.159.176.226 (11 Jul 2018 03:41:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2018 03:41:17 +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 Wed Jul 11 05:41:13 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 1fd608-00052v-3m for ged-emacs-devel@m.gmane.org; Wed, 11 Jul 2018 05:41:12 +0200 Original-Received: from localhost ([::1]:51497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fd62D-0003dy-GB for ged-emacs-devel@m.gmane.org; Tue, 10 Jul 2018 23:43:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fd61c-0003dt-Ij for emacs-devel@gnu.org; Tue, 10 Jul 2018 23:42:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fd61X-0003S3-N0 for emacs-devel@gnu.org; Tue, 10 Jul 2018 23:42:44 -0400 Original-Received: from [195.159.176.226] (port=36923 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fd61X-0003Rn-Fh for emacs-devel@gnu.org; Tue, 10 Jul 2018 23:42:39 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fd5zM-0004II-W2 for emacs-devel@gnu.org; Wed, 11 Jul 2018 05:40:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:FmcjxZI57MEzyoRdVA1fVOBOkvc= 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:227240 Archived-At: > subr and compiled-functions are distinct (nonintersecting) types, whereas > bignum is a subset of integer, so these are quite different cases. The > manual says "each object belongs to one and only one primitive type; > ‘type-of’ tells you which one". But if type-of returned 'integer' and > bignums are integers (which they should be), this statement in the manual > would become false, and would need to be rewritten. I don't see this > as a win. Actually, the incorrect statement would be when (type-of 5) returns `integer` since `integer` wouldn't be a primitive type any more. > True, it's pretty rare. And it is a relic of the old-fashioned days when > types were all disjoint. (Maybe we should remove 'type-of'? :-) FWIW, I dislike type-of and would be happy to get rid of it (and replace it with a cl-generic-specific function instead which would fix some of its shortcomings for that use-case). > I'm not all that worried about type-of. I am more worried about the idea > that bignums are second-class integers. When at all possible, bignums should > be treated the same way that any other (large) integer is treated. Fully agreed. I just see `type-of` as a function that reports about the actual representation so it's OK for it to reveal differences which will rarely affect normal code. Stefan