From 709f327e4e8e6c002151c66ed147a65e178bafc5 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 1 Jan 2019 14:32:43 -0700 Subject: [PATCH] io: remove incorrect symbol shortcut for `format` and "~s" As exposed by a "print.rktl" test, the shortcut was wrong for symbols that write with escapes. --- racket/src/io/format/main.rkt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/racket/src/io/format/main.rkt b/racket/src/io/format/main.rkt index 2d71fff43a..9799194488 100644 --- a/racket/src/io/format/main.rkt +++ b/racket/src/io/format/main.rkt @@ -36,7 +36,6 @@ (cond [(boolean? a) (string-copy (if a "#t" "#f"))] [(number? a) (number->string a)] - [(symbol? a) (symbol->string a)] [(keyword? a) (string-append "#:" (keyword->string a))] [else #f])) @@ -49,6 +48,7 @@ (cond [(bytes? a) (bytes->string/utf-8 a #\?)] [(string? a) (string-copy a)] + [(symbol? a) (symbol->string a)] [else (general-format fmt (list a))]))] [(or (equal? fmt "~s") (equal? fmt "~S")) (or (simple-format a)