#569 closed defect (wontfix)
integer->char doesn't work right with negative numbers
| Reported by: | shawnw | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 4.9.0 |
| Component: | core libraries | Version: | 4.6.x |
| Keywords: | Cc: | ||
| Estimated difficulty: |
Description
(integer->char -1) => #\U1fffff but (char->integer #\U1fffff) => 2097151
Found this when trying to make a non-blocking ncurses app: getch and friends return -1 when there's no ready input.
Change History (4)
comment:1 Changed 15 years ago by
| Milestone: | 4.7.0 → 4.8.0 |
|---|---|
| Owner: | set to felix winkelmann |
| Status: | new → assigned |
comment:2 Changed 14 years ago by
| Owner: | felix winkelmann deleted |
|---|
comment:3 Changed 14 years ago by
| Resolution: | → wontfix |
|---|---|
| Status: | assigned → closed |
Currently integer->char can be completely inline. Adding such a check seems prohibitive, since this primitive is used extensively in internal string-processing procedures.
Note: See
TracTickets for help on using
tickets.

Probably
integer->charshould catch this and throw an error. But this will require yet another runtime check. I'll add a note to the manual for the time being.