mmmm footgun
@mflatt is there a way to compile your chez fork on osx w/o X11? I wanted to poke but it dies on compile very quickly and I don’t see obvious config options for this.
@zenspider That’s an issue with building Chez Scheme that has bothered many. I don’t have an easy workaround, but I think it must be a solvable problem, and I’ll take a look again soon.
Hello everyone! )
I don’t know why, but (list->string (list #\\))
produces double backslash "\\"
instead of the single one "\"
Is there any solution to use a backslash like a symbol? By using #\backslash
for example (the last one unfortunately doesn’t exist).
Racket uses the same convention as some other programming languages like C, that in literal and printed strings, \
is an escape character. So e.g. "\n"
means the newline character ASCII 11. "\r"
means the return character ASCII 13. And so on.
They’re actually single characters.
And if you want \
, then you use two of them, "\\"
.
For instance, try (car (string->list (list->string (list #\\))))
. It prints #\\
.
@dmitryhertz Does that help or am I misunderstanding your question?
Hm, when I try to eval (displayln (list->string '(#/ #\1 #\\ #\2 #/ #\3 #\\ #\4 #/ #\5 #\\)))
every backslash behaves itself as expected. So, the result is /1\2/3\4/5\
.
I meant above, the problem didn’t exist at all. It was my misunderstanding.
As well as displayln
, try print
.
@greg Sorry please, all is okay.
Ok, I’ll try print
right now
(print (list->string '(#/ #\1 #\\ #\2 #/ #\3 #\\ #\4 #/ #\5 #\\)))
the result is "/1\\2/3\\4/5\\"
.
So print
shows you it the same as you’d write it as a Racket literal string — e.g. \\
.
display
shows you the “result” when displayed — e.g. \
.
Maybe I’m explaining the distinction badly here but hopefully you get the idea. :slightly_smiling_face:
Once in awhile it can be confusing.
@greg your explanation is great! Seriously. Thank you! )
Great! Have fun.
Does ;
before #\|
turn off the multi-line commenting in Racket? It seems to in mine.
@iam has joined the channel
@hellochazcampos has joined the channel