[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (declare (type fixnum ---)) considered etc.
- Subject: Re: (declare (type fixnum ---)) considered etc.
- From: firstname.lastname@example.org (Stanley Shebs)
- Date: Thu, 24 Jul 86 11:26:12 MDT
- Apparently-to: email@example.com
- Newsgroups: fa.common-lisp
- Organization: University of Utah CS Dept
- References: <860723162942.2.CASSELS@KRYPTON.SCRC.Symbolics.COM>
- Reply-to: shebs@utah-orion.UUCP (Stanley Shebs)
In article <860723162942.2.CASSELS@KRYPTON.SCRC.Symbolics.COM> Cassels@STONY-BROOK.SCRC.Symbolics.COM (Robert A. Cassels) writes:
>Aha! What you want is for type FLOAT to take precision and exponent
>size arguments. So IEEE single-float would be (FLOAT-BINARY 24 8). We
>could accept (FLOAT-DECIMAL 6 2) for those who think in base 10. )Well,
>yes as a matter of fact, I did once write a PL/I program. :-(
I think this is a GREAT idea. (the type specifier, not the PL/I :-)
>Then we could move SINGLE-FLOAT, etc. to SYS: along with FIXNUM and
>everyone would be happy.
>(For this to become a real proposal, someone will have to figure out a
>new reader syntax for floating-point constants. The current s/f/d/l
>exponent mark hack depends on the current set of types.)
Well, since elaborating the FLOAT type increases the size of the language,
we should counteract that by flushing s/f/d/l, retaining only e for the
exponent marker, and use *read-default-float-format*. To avoid having to
rebind this global for just one read, use #F. For instance, you could
handle .1003l45 as #69,23F(1003 45). It's more longwinded, true, but
is considerably more precise and therefore more portable. Depends on how
determined we are to retain total compatibility with Fortran syntaxes
that were invented 30 years ago I guess...
On the other hand, this proposal logically requires bigfloats, otherwise
you have to have a maximum-mantissa-size parameter etc for each CL, and
if somebody's Cray program wants 240 bit mantissas, they're not going to have
much luck on Vaxen. Bigfloats don't bother me - they would win just like
bignums do now.