
: Less than two weeks left to get your RacketCon tickets at early bird prices! http://con.racket-lang.org/#register

@robkuz has joined the channel

Is this the best way of getting whitespace characters into my console output? (displayln (string-append "hello" (~a #\tab) "esteemed user"))

Concatenating string parts together with converted whitespace characters

Thinking I might write a little macro to provide convenient/dangerous interpolation that I’m accustomed to from PHP: http://php.net/manual/en/language.types.string.php#language.types.string.syntax.double

Normal escape characters work fine in racket literals so you could have done (displayln "hello\testeemed user")
and it would be the same afaik. Using string-append
is fine too. What you did is also equivalent to (displayln (format "hello~aesteemed user" #\tab"))
.

Oh, thanks! I made the mistake of originally building this example with writeln

Yeah that can be confusing. Good rule of thumb is that display
formats for output (so for example #\a
prints as simply a
), while write
formats so the output can be read back in as racket syntax (so #\a
would print back as #\a
).


@royall For some things at-expressions can be handy: http://www.greghendershott.com/2015/08/at-expressions.html

I’ve been working with web-server/servlet for a little while now, and I’ve been wondering, does it matter if I reuse embed/url
between requests? or should I get a new embed/url for each request?