[plt-scheme] Identifying at-exp string literals
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 <br/> 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'?:
@~xml{....}
Still, if you really want to distinguish concrete forms, the @-notation
reader installs syntax properties that would let you do that:
http://docs.plt-scheme.org/scribble/reader.html#%28part._.Syntax_.Properties%29