[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #o and unsignedness
- To: Guy.Steele at CMU-10A
- Subject: Re: #o and unsignedness
- From: Robert W. Kerns <RWK at MIT-MC>
- Date: Sat, 1 Nov 80 17:30:00 GMT
- Cc: BUG-LISP at MIT-MC
- Original-date: 1 November 1980 12:30-EST
Date: 31 October 1980 1722-EST (Friday)
From: Guy.Steele at CMU-10A
To: RWK at MIT-MC (Robert W. Kerns)
Subject: Re: #o and unsignedness
CC: bug-lisp at MIT-MC
In-Reply-To: RWK@MIT-MC's message of 31 Oct 80 16:13-EST
Message-Id: <31Oct80 172251 SL5P@CMU-10A>
The truncation I referred to was chopping off the poor "integer"
and forcing it to fit into a fixnum (thereby causing some bits
possibly to be lost, but in any case suddenly altering the
weight of one of its bits, from 2^25 to -2^35!!!).
Ah, but this altering of the weight of one of it's bits only occurs when you
stop thinking of it as an unsigned integer. One wouldn't use #*O when one
meant anything other than an unsigned integer, so this altering in meaning
wouldn't occur. This is no different than packing two nubers into a single
integer, representing a character by a fixnum, etc. If I'm representing
something like 2 18-bit positive numbers, and consider the combination as
a combination of 2 18-bit numbers consistantly, it doesn't matter at all to
me that occasionally one of these combininations would be considered to be
negative if considered as a single fixnum on a machine of 36 bits or less;
I never consider them as a single fixnum!
There is a problem with #*O..., which is that if #B means binary
then #*B is ambiguous on a machine where just plain #* means
hexadecimal.
Not if #* by itself never means hexadecimal, which was my proposal.
Letting #* vary in radix from machine to machine isn't all that
much of a problem -- the machines may have different word
lengths as well, after all.
They also may have a different number of disk drives. So what? So my code
shouldn't read in even aproximately, because when I wrote #*ABC, now it tries
to read it as octal? Tell me what GOOD it does to have the base varying and
unspecified, as opposed to specified.
Indeed, there is a nice symmetry between *, +, and - -- that's
why I originally proposed to use *nnnn* (the stars actually
being independent -- the treailing star was the "machine-radix point",
and the leading one meant "unsigned fixnum" -- so that -nnn*
and *ddd. actually made sense. But reason prevailed, and we
got #*, which actually is rather nice to me now.)