emacs-devel
[Top][All Lists]
Advanced

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

Re: integer overflow


From: Helmut Eller
Subject: Re: integer overflow
Date: Sat, 06 Mar 2010 20:04:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

* Stefan Monnier [2010-03-06 16:45+0100] writes:

>>>> Can you summarize how it's supposed to work?
>>> The change affects the Lisp reader: reading "536870912" or any larger
>>> number now gives you a float Lisp object, instead of an integer Lisp
>>> object (since there is no way to represent 536870912 or larger as
>>> integers).  536870911 and below are still read as integers.
>> What's the point of doing that?  I would much prefer if read would just
>> raise an error.
>
> There are many cases where it's important to read an integer from some
> other program, so it's important to be able to read integers larger the
> Elisp's largest fixnum (tho less so for integers larger than the
> host system's natural "int").
> Examples are file sizes, process ids, user ids, ...

read doesn't seem the right tool for this job; read is for parsing Lisp
syntax.  Those few programs which produce Lisp syntax should probably
just write floats if there is a danger of overflow and precision doesn't
matter.  For those cases were precision does matter (eg. a 32bit Emacs
reading a file produced by a 64bit Emacs) I'd prefer an error instead of
automatic coercions.

Helmut




reply via email to

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