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

code-char bug?



I think I found a small bug in code-char in MCL 2.0b1p3.  code-char
takes a positive integer and converts it into a char.  In CLtL2 (pg.
382) it says if a corresponding char can't be found, nil is returned.
MCL gives the following instead:

? (code-char 256)
> Error: Argument 256 is not of type (INTEGER 0 255).
> While executing: CODE-CHAR
Aborted
? 

This may have been missed since the entire old definition of code-char
has a dotted-line beside it.  The part with the solid-line just says
that the old bits and font arguments are now defunct.  On page xiii it
says that you should be 'wary' of information with a dotted-line
beside it, but given that the solid-line part says nothing about the
behavior when the code argument is out of range, it seems (code-char
256) should still return nil.  I just checked MCL 1.3.2 and it also
signals an error, which is definitely wrong.  The fix is obvious.

Nathan Wilson
Teleos Research
nathan@teleos.com