From cf72bace95db0b1788361f96a7f5775d63e8bb72 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 30 Jan 2019 20:29:45 -0700 Subject: [PATCH] cs: fix printing of some symbols Commit bd6cf17f92 wasn't the right repair. --- racket/src/cs/expander.sls | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/racket/src/cs/expander.sls b/racket/src/cs/expander.sls index 9d3463f5e1..2ae40d4e01 100644 --- a/racket/src/cs/expander.sls +++ b/racket/src/cs/expander.sls @@ -208,7 +208,11 @@ ;; the printer needs to check whether a string parses as a number ;; for deciding wheter to quote the string (set-string->number?! (lambda (str) - (number? (1/string->number str 10 'read)))) + (and (1/string->number str 10 'read) + ;; Special case: `#%` is never read as a number or error: + (not (and (>= (string-length str) 2) + (eqv? (string-ref str 0) #\#) + (eqv? (string-ref str 1) #\%)))))) ;; `set-maybe-raise-missing-module!` is also from the `io` library (set-maybe-raise-missing-module! maybe-raise-missing-module))