[plt-scheme] define own escape sequences?

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Jun 15 18:57:20 EDT 2009

On Jun 15, Paul Graham wrote:
> Can anyone tell me how to define my own escape sequences within
> strings in mzscheme?  I looked in the manual and I can't find it
> anywhere.  (All I want to do is make (unescaped) \@ be left intact
> in strings instead of triggering an error.)  Thanks!

There is no hook for extending the string syntax, so you'll need a new
reader macro for strings.  If you want all of mzscheme's escapes, then
the tedious part in this will be all the numeric escapes (octal and
hex).  So depending on the problem you're trying to solve, it might be
easier to define a new kind of escape, or maybe use something like the
scribble syntax (http://docs.plt-scheme.org/scribble/reader.html).

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.