[racket] Changing at-expressions to other-glyph-expressions

From: Matthew Butterick (mb.list.acct at gmail.com)
Date: Fri Apr 19 19:42:40 EDT 2013

Thanks. Yes, I did see that in the docs. The problem with this technique is
that once I wrap the input text in @list| (or @list|^, or ... etc.) to get
the benefit of @-escaping, then I lose the ability to do defines within the
body of that text. (Throws error "define not allowed in expression
context.")

"But you can move the defines outside the @list| form, as seen in
https://gist.github.com/dyoo/5423623." True, but in that case, I can no
longer programmatically parse my source files, since they may have defines
within them. (This is, as I understand it, the major benefit of using
scribble/text as a preprocessor — you get all the Racket constructs. Define
is a big one ;)

Meanwhile, I can think of about a zillion unicode glyphs that are
definitely NOT in any of these source files and never will be. Thus my
question about whether one can simply remap at-expressions onto some other
glyph. (See, e.g., perl's ability to use any glyph as a regexp delimiter,
to avoid incessant and possibly error-prone escaping.)

For instance, Lao digit one (Unicode U+0ED1) … it even resembles an at sign!

໑(define foo 'bar)


On Fri, Apr 19, 2013 at 3:15 PM, Danny Yoo <dyoo at hashcollision.org> wrote:

> Can you use the escaping syntax that Scribble provides?  Here's an example:
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> #lang scribble/base
> @list|{ this is an example with @ signs in it.  I can still
>        use @ by using it like this: |@tt{Hello world}, right?}|
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> It's documented in:
>
>
> http://docs.racket-lang.org/scribble/reader.html#(part._.The_.Scribble_.Syntax_at_a_.Glance)
>
> starting around the paragraph: "In some cases, a text contains many
> literal @s..."
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130419/b3f1c542/attachment.html>

Posted on the users mailing list.