refuse a char literal that is not one byte
A char is C's, and #\λ came out a multi-character constant whose value is the C compiler's to choose.
This commit is contained in:
@@ -445,10 +445,15 @@
|
||||
("delete" . #\delete) ("escape" . #\escape) ("alarm" . #\alarm)
|
||||
("backspace" . #\backspace)))
|
||||
|
||||
;;; A char is C's, one byte: #\λ was a multi-character constant, whose
|
||||
;;; value is the C compiler's to choose
|
||||
(define (read-char-lit port)
|
||||
(let ((first (get-ch port)))
|
||||
(when (eof-object? first)
|
||||
(error "Unexpected end of input in character literal"))
|
||||
(when (> (char->integer first) 127)
|
||||
(error "a char is one byte, and this is not: write its code point, or a string"
|
||||
first))
|
||||
(if (char-alphabetic? first)
|
||||
(let ((rest (read-atom-string port)))
|
||||
(if (string=? rest "")
|
||||
|
||||
Reference in New Issue
Block a user