[plt-scheme] jumping comma
On Sat, 31 Dec 2005, Andreas Zwinkau wrote:
> I don't know, what to make out of this behaviour:
> > '(jumping, comma)
> (jumping ,comma)
> Why does the comma jump from "right of jumping" to "left of comma"?
Hi Andi,
Others have already shown that the comma is treated as a special case by
the reader function. By the way, if we do want to have a list whose
content contains what I think you'd like to have, then we can use vertical
bars or backslashes to escape comma-ed symbols:
;;;;;;
> (define mylist '(jumping |,comma|))
> (car mylist)
jumping
> (cdr mylist)
(|,comma|)
> (symbol->string (cadr mylist))
",comma"
;;;;;;
Section 11.2.4 of the language manual talks about this a few paragraphs
down:
http://download.plt-scheme.org/doc/300/html/mzscheme/mzscheme-Z-H-11.html#node_sec_11.2.4
(By the way, the documentation there still says that the reader will treat
symbols case-insensitively by default; I think the documentation needs to
be updated. It still reads "By default, symbols are read
case-insensitively (i.e., characters are case-folded) ..." in the
pre-production docs too.
Best of wishes to you!