emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using the GNU GMP Library for Bignums in Emacs


From: Paul Eggert
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Tue, 10 Jul 2018 09:01:44 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 07/09/2018 08:41 PM, Stefan Monnier wrote:
As long as `eq` treats bignums differently from fixnums, I think type-of
should return different values for the two
I don't see how this folds into your earlier point about cl-generic's 
dispatch. I thought the idea of cl-generic was to define a generic 
function that finds the most specialized method for its arguments. (I'm 
no expert in cl-generic, so please bear with me if I'm wrong.)
If so, why would someone want to specialize a method just for fixnums, 
as opposed to a method for integers? The basic operations +, -, * etc. 
aren't specialized for fixnums. Are you anticipating adding specialized 
variants fixnum-+, fixnum--, fixnum-*, etc., and then having people 
write methods with all this in mind? Or maybe having the bytecode 
optimizer use them?
If so, I suspect that approach won't be needed for Emacs Lisp. Elisp 
programs are not typically intended for that sort of microptimization -- 
otherwise we'd already have operations like integer-+, integer--, 
integer-*, etc. And the complexity of the differing semantics (fixnum-+ 
would wrap around, whereas + would not) would probably not be worth the 
relatively minor performance benefits.
If not, then I'm still not following the advantage of having (type-of 5) 
return something other than 'integer'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]