Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#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 9 years ago by felix winkelmann

Milestone: 4.7.04.8.0
Owner: set to felix winkelmann
Status: newassigned

Probably integer->char should 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.

comment:2 Changed 9 years ago by felix winkelmann

Owner: felix winkelmann deleted

comment:3 Changed 9 years ago by felix winkelmann

Resolution: wontfix
Status: assignedclosed

Currently integer->char can be completely inline. Adding such a check seems prohibitive, since this primitive is used extensively in internal string-processing procedures.

comment:4 Changed 8 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.