avoid (format "~s" x) in favor of (symbol->string x) for symbols

when doing typesetting stuff in Redex, as the former seems to have
some kind of context dependency that makes it insert ||s around
some upper-case symbols sometimes
This commit is contained in:
Robby Findler 2011-12-10 02:53:51 -06:00
parent ccbd5d51fd
commit 622bec0719
2 changed files with 3 additions and 4 deletions

View File

@ -374,7 +374,7 @@
who
(length lst)
(apply string-append
(format "~s" (car lst))
(format "~s" fst)
(map (λ (x) (format " ~s" x)) (cdr lst)))))
(values fst snd))
(values fst (blank)))))
@ -679,7 +679,6 @@
[(pict-token? tok) (pict-token-pict tok)]
[else (error 'token->pict "~s" tok)]))
(define (atom->tokens col span atom all-nts unquoted?)
(cond
[(pict? atom)
@ -702,7 +701,7 @@
(make-pict-token (+ col span) 0 sub+sup)))])]
[(or (memq atom all-nts)
(memq atom '(number variable variable-except variable-not-otherwise-mentioned)))
(list (non-terminal->token col span (format "~s" atom)))]
(list (non-terminal->token col span (symbol->string atom)))]
[(symbol? atom)
(list (or (rewrite-atomic col span atom literal-style)
(make-string-token col span (symbol->string atom) (literal-style))))]

View File

@ -58,7 +58,7 @@
[(string? e)
(values line col (+ col (string-length e)))]
[(symbol? e)
(values line col (+ col (string-length (format "~s" e))))]
(values line col (+ col (string-length (symbol->string e))))]
[(not e) (values line col col)]
[else
(let loop ([lws e]