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

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Feb 9 15:20:04 EST 2012

A few minutes ago, Jay McCarthy wrote:
> On Thu, Feb 9, 2012 at 12:19 PM, Eli Barzilay <eli at barzilay.org> wrote:
> > 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.
> 
> I see no docs for with-writer or scribble/html, so I don't know what
> these are.

No docs becasue I don't have a good API yet, so it's still a kind of a
private backdoor.  (And that's what I'd like to change.)


> > (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.)
> 
> Ya, the procedure property sounds like the way to go.

OK.  (I was hoping that there's a need for an organized writer thing
to sort out the above...)

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


Posted on the users mailing list.