[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Issue FIXNUM-NON-PORTABLE, v4
- To: Kim A. Barrett <IIM@ECLA.USC.EDU>
- Subject: Re: Issue FIXNUM-NON-PORTABLE, v4
- From: masinter.pa@Xerox.COM
- Date: 8 Jan 89 23:31 PST
- Cc: cl-cleanup@SAIL.STANFORD.EDU
- In-reply-to: Kim A. Barrett <IIM@ECLA.USC.EDU>'s message of Sat, 31 Dec 88 19:47:14 PST
The portable use of FIXNUMs that convinced me came from applications that
wanted to use, say, a list of fixnums instead of a bit vector or a bignum
as an efficient representation of an arbitrary length sequence of bits.
For such an application, the FIXNUM type is ideal: it is the largest
"efficient" set of integers, and any explicit ranged integer type specifier
would not have the right properties.
I thought it was a legitimate portable use of the FIXNUM tpe. It is really
only a portable use of FIXNUM if FIXNUM is constrained to be a "reasonable"
size, however; e.g., it doesn't work if MOST-POSITIVE-FIXNUM is negative!
Constraining FIXNUM to be a reasonable size also makes other uses of FIXNUM
more legitimate. Perhaps we could make FIXNUM more useful if we required
MOST-POSITIVE-FIXNUM to be at least as big as ARRAY-DIMENSION-LIMIT or
CHAR-CODE-LIMIT or could be guaranteed to hold the largest "count" of
objects, e.g., that LENGTH always returns a FIXNUM. An alternative would be
to invent new types, e.g.,
(deftype array-dimension () `(integer 0 ,array-dimension-limit))
What should the name of "an integer big enough to count objects" be?