[racket] Ensuring data fed to web-server/templates is textual

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Feb 9 14:19:11 EST 2012

Yesterday, Jay McCarthy wrote:
> web-server/templates uses scribble/text
> So, if you return a function, then it will be called.
> We could also change scribble/text to support a struct/class
> property for JIT transformation. Does that sound good?
> Is that okay with you, Eli?

Why a property?  There is already a `with-writer' that can be used to
apply a custom writer, and that's how `scribble/html' does things.

But that feature is not really great, IMO, and I really want to get
something better instead -- something where I can compose a bunch of
writers (in a form of input-regexp, output-string), disable some,
etc.  If anyone is interested in trying to get something here I'd be
happy to provide more details.

(And going back to the property, if you're looking for a way to do
this for some particular value, then the right way to do this is to
use the procedure property -- the text outputter treats anything that
looks as a thunk by applying it to get the value to actually put out.)

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.