[plt-scheme] Identifying at-exp string literals

From: Dave Gurnell (d.j.gurnell at gmail.com)
Date: Mon Sep 21 06:46:48 EDT 2009

Hi all,

I'm looking for a way to write a macro that can distinguish string  
literals that do and don't come from at-expression boilerplate. For  
example, in the following code:

     (define b "b")

     @list{a @b c}

I'd like to be able to differentiate "a " and " c" from "b".

My motivation: I'd like to make the (xml ...) macro from Mirrors.plt  
at-expression-aware so that at-exps and s-exps are ampersand-encoded  
differently. In other words, s-expression "<" and ">" are &-encoded:

     (xml (p "The <br/> tag is a line break."))

          ==> <p>The &lt;br/&gt; tag is a line break.</p>

whereas at-expression "<" and ">" are not:

     @xml{<p>The <br/> tag is a line break.</p>}

          ==> <p>The <br/> tag is a line break.</p>

Any advice would be much appreciated.

Many thanks,

-- Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090921/86a65f2f/attachment.html>

Posted on the users mailing list.