[plt-scheme] Proposed changes to Mirrors
Dave Gurnell wrote at 03/11/2009 08:45 AM:
>
> I'm toying with a very mildly backwards-incompatible idea that will
> prevent this kind of thing.
I had that and other problems. My own HTML/XML templating syntax (which
does most of the computation at syntax expansion time, as I've mentioned
here before) now actually has three different escapes, rather than just
an unsyntax:
* (%value EXPR ...) --- At evaluation (write) time, at this point in the
writing, evaluate the Scheme EXPRs as if in a "begin" form, and the last
value then SXML/SHTML that is is written as XML/HTML.
* (%effects EXPR ...) --- At evaluation (write) time, at this point in
the writing, evaluate the EXPRs for their effects as if in a "begin",
with current output port set to the XML/HTML output port, and ignore any
value produced.
* (%verbatim STRING-LITERAL ...) --- At this point in the writing, the
content of the string literals will be written verbatim as part of the
XML/HTML output.
These have been through a few design iterations. These are the three
main distinctions I've found I want, and confusing them tends to lead to
errors. I also abandoned my terse, cryptic syntaxes, and settled upon a
consistent visual marker ("%") followed by a name that clearly names the
kind of escape.
I have other features for inline JavaScript and CSS in SHTML, as well as
for CDATA, but I might eventually turn those into escapes in the
templating language.
--
http://www.neilvandyke.org/