base-char bug with SBCL unicode

Robert Strandh <[email protected]> Tue, 28 Dec 2004 12:57:18 +0100
Newsgroups gmane.lisp.clx.devel
Message-ID <[email protected]>
Hello, 

Today, I tripped over a bug in which some (probably inlined) call to
char->card8 blew up for non-ascii characters.  Christophe Rhodes seems
to think it is the use of base-char in this code snippet in the file
dependent.lisp:

     #-Genera
     (progn
       (defun char->card8 (char)
	 (declare (type base-char char))
	 #.(declare-buffun)
	 (the card8 (aref (the (simple-array card8 (*))
			       *char-to-card8-translation-table*)
			  (the array-index (char-code char)))))
       (defun card8->char (card8)
	 (declare (type card8 card8))
	 #.(declare-buffun)
	 (the base-char
	      (or (aref (the simple-vector *card8-to-char-translation-table*)
			card8)
		  (error "Invalid CHAR code ~D." card8))))
       )

Christophe thinks (sb-kernel:character-set ((0 . 255))) would be more
appropriate for SBCL.

-- 
Robert Strandh

---------------------------------------------------------------------
Greenspun's Tenth Rule of Programming: any sufficiently complicated C
or Fortran program contains an ad hoc informally-specified bug-ridden
slow implementation of half of Common Lisp.
---------------------------------------------------------------------

_______________________________________________
Portable-clx mailing list
[email protected]
http://lists.metacircles.com/cgi-bin/mailman/listinfo/portable-clx
cvs -d :ext:cvs.telent.net:/usr/local/src/cvs co clx  # over ssh
cvs -d :pserver:[email protected]:/cvs co clx  # anonymous