[plt-scheme] How to get the reader to accept a single backslash?

From: Grant Rettke (grettke at acm.org)
Date: Sun Sep 2 20:48:18 EDT 2007

Hi,

I'm trying to generate the string "C\#" but can't seem to accomplish this.

Here is what I've tried:
"C\#" -> won't execute in the repl
;
(string-append "C" "\" "#") -> won't execute in the repl
;
(string-append "C" "\\" "#") -> "C\\#"
;
(string-append "C" (symbol->string '\) "#") -> won't execute in the repl
;
(string-append "C" (symbol->string '\\) "#") -> "C\\#"

The problem is that I don't see how to input a single backslash since
it is the escape sequence indicator. I don't understand why \\ shows
up as double slash in strings.

What am I doing wrong? Where should I read up on this?


Posted on the users mailing list.