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

Re: an alternate BOGUS-FIXNUMS proposal

   Forcing users to DEFTYPE their own integer subrange types instead
   would encourage better use of data abstraction.  I've noticed that
   Lisp programs are typically much sloppier about this than programs
   written in strongly typed languages such as C or Pascal.

Me: There are certainly many programs that use "int" or "long", and
   those are analogous to FIXNUM, not to explicit ranges of integers
   or numbers of bits.

   Yes, people do declare things as "int" in C code without giving a
   great deal of thought to how big an "int" really is.  But in my mind,
   not being guaranteed anything about integer sizes in C (and not being
   able to define subrange types as you can in Pascal) is a misfeature.
   I don't think its presence in C is a valid justification for including
   it in Lisp.  [Followed by example of program that avoids using int or
   long directly by using system-specific typedefs.]

My point was that C (and Pascal) programs do use "int", and that this is
analogous to FIXNUM.  While some C programs take more care (if they are
concerned about portability to a wide range of machines), so do some Lisp
programs.  I do not agree that C programs typically show more care than
Lisp programs about this particular issue (though they must, of course, be
more careful about types in general): a great many C programs simply use
"int" or "long".  Nor it is the case that C and Pascal *force* users to
define their own integer subrange types.  And, well, all this is not to
show that "int" in C justifies FIXNUM in Lisp but only that your argument
in favor of "forcing users", etc. does not have the support from C and
Pascal that you suggest.

One the contrary, C and Pascal show that "int" is useful and that forcing
users to define subranges is not necessary.  This point is valid, because
is shows that such ill-defined types are nonetheless useful.  Perhaps it
would not be enough to justify adding FIXNUM to Lisp, but since you are
suggesting a change to CL, the burden of proof is on you to show that
FIXNUM should be removed and that its utility is outweighed by other

Jeff Dalton,                      JANET: J.Dalton@uk.ac.ed             
AI Applications Institute,        ARPA:  J.Dalton%uk.ac.ed@nss.cs.ucl.ac.uk
Edinburgh University.             UUCP:  ...!ukc!ed.ac.uk!J.Dalton