[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(declare (type fixnum ---)) considered etc.
- To: "David C. Plummer" <DCP@SCRC-QUABBIN.ARPA>
- Subject: (declare (type fixnum ---)) considered etc.
- From: Rob MacLachlan <RAM@C.CS.CMU.EDU>
- Date: Wed, 23 Jul 1986 14:39:00 -0000
- Cc: common-lisp@SU-AI.ARPA, "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>, masinter.PA@XEROX.COM
- In-reply-to: Msg of 22 Jul 1986 16:53-EDT from David C. Plummer <DCP at QUABBIN.SCRC.Symbolics.COM>
Well, I had previously believed that the FIXNUM declaration was
reasonable, but this was based on the erroneous belief that an array
index must be a fixnum. If it is fact the case that some
implementations have small (2^16) fixnums, then this is a serious
source of non-portability. A possible solution would be to have an
INDEX type which is (INTEGER 0 (ARRAY-DIMENSION-LIMIT)).
In any case, I think there are valid arguments for retaining the
1] Much existing code would have to be changed. This code will probably
work on any implementation for some range of inputs.
2] There is precendent for sacrificing portability to gain
The problem with saying something like (SIGNED-BYTE 32) is that it is
probably just as arbitrary as FIXNUM, yet is unlikely to be a good
match for a given implementation. In fact in this particular case,
nearly all implementations on conventional hardware would be forced to
It seems that FIXNUM is no less portable than FLOAT, since nothing is
guaranteed about float exponent range and precision. A Common Lisp
program which uses floats cannot be totally portable. One could take
this as an argument against the currently system of float types, but
I don't have a better solution.
I suggest that there should be some short integer type which is
defined to have a reasonably large magnitude (> 2^20). This is
analogous to the float types which have suggested minimum precisions.
Note that CLTL currently suggest (p 14) that FIXNUM be at least
(SIGNED-BYTE 16), so uses of FIXNUM consistent with this can be