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

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Feb 9 15:13:17 EST 2012

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.

>
> 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.)

Ya, the procedure property sounds like the way to go.

Jay


-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.