Supporting hex char escapes in extended reader.

This commit is contained in:
Alex Shinn 2012-11-02 00:02:26 +09:00
parent 6803c7311a
commit 9cae7fada9

View file

@ -187,6 +187,10 @@
(define (read-named-char c in)
(let ((name (read-name c in)))
(cond ((assoc name named-chars string-ci=?) => cdr)
((and (or (eqv? c #\x) (eqv? c #\X))
(string->number (substring name 1 (string-length name))
16))
=> integer->char)
(else (error "unknown char name" name)))))
(define (read-type-id in)
(let ((ch (peek-char in)))