>>>> "Stephen" == Stephen J Turnbull
<turnbull(a)sk.tsukuba.ac.jp> writes:
Stephen> The appended patch swaps the Lisp integer with the Lisp
Stephen> character representations, so that characters have 31
Stephen> bits of precision.
[...]
Stephen> Second, I tracked down all uses of Lisp_Type_* and am
Stephen> fairly confident that these are correct in the patch. I
Stephen> have this nagging feeling I'm missing something that I
Stephen> should be verifying, though.
OK, one obvious thing I missed is use of the VALBITS macros. I'll
chase those down.
Also, Morioka-san mentioned `char-int' will break. Actually, this
isn't true, in the sense that we've never had characters as big as 29
bits so _all_ existing uses are still available. The main problem I
can see is that someone might have a huge "character set" with
integer-like properties that they would want to put into UCS-4 private
space. Not likely, IMO. This set would have more than 65536 members,
otherwise they can use private space planes in Group 0, well below the
29-bit barrier.
For compatibility, I propose using a hack like
if ((unsigned int) (ch >> 1) < 2**29)
make-int (ch >> 1)
else
XCONS (make-int ((ch >> 1) & (2**29 - 1)), make-int (ch >> 30))
to implement char-int, and convert to bignums when we get them.
(Maybe that should throw an exception, instead?) For the foreseeable
future, only people using private space in Groups 60 to 7F will have
to be concerned about it; we've barely begun thinking about Planes 2
and 3, let alone Group 1 AFAIK.
(We might put the entire 19-bit Mule character set up in private
space, as a compatibility hack---but we'd want to do that in C, not in
Lisp.)
--
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
__________________________________________________________________________
__________________________________________________________________________
What are those two straight lines for? "Free software rules."