code-char doesn't return nil on failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sbcl (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The HyperSpec entry for code-char [1] reads:
"Returns a character with the code attribute given by code. If no such character exists and one cannot be created, nil is returned."
On the following code, however, a STREAM-
This is SBCL 0.9.8, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (code-char (1- char-code-limit))
debugger invoked on a SB-INT:
#<THREAD "initial thread" {A7BE341}>:
encoding error on stream #<SB-SYS:FD-STREAM for "standard output" {A7BE591}>
(:EXTERNAL-FORMAT :ASCII):
the character with code 1114111 cannot be encoded.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-
0: [OUTPUT-NOTHING] Skip output of this character.
1: [ABORT ] Exit debugger, returning to top level.
(SB-INT:
#<SB-SYS:FD-STREAM for "standard output" {A7BE591}>
1114111)
0]
This bug causes FiveAM [2] to break SLIME [3] when using its gen-character and gen-string generators.
[1] http://
[2] http://
[3] http://
0.9.17 now does the right thing:
$ sbcl www.sbcl. org/>.
This is SBCL 0.9.17, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (code-char (1- char-code-limit))
#\U0010FFFF