[plt-scheme] Identifying at-exp string literals

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Sep 21 08:25:17 EDT 2009

At Mon, 21 Sep 2009 11:46:48 +0100, Dave Gurnell wrote:
> 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>

To me, distinguishing those cases goes against the spirit of
@-notation. I think it's a great benefit that S-exprs and @-notation
are interchangeable.

How about introducing a different binding for the variant that doesn't
&-encode, maybe `~xml'?:


Still, if you really want to distinguish concrete forms, the @-notation
reader installs syntax properties that would let you do that:


Posted on the users mailing list.