[racket-dev] Removing Xexpr preference from Web Server

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue Dec 7 16:17:05 EST 2010

I've just committed the culmination of this thread.

I've removed the coercive contracts and replaced them with a global
imperative any->response hook that defaults to "off" but can easily be
turned "on" to support X-exprs or the old behavior of the Web Server.

Jay

On Fri, Nov 26, 2010 at 5:55 PM, Jay McCarthy <jay.mccarthy at gmail.com>wrote:

> I would like to remove the implicit preference the Web Server gives to
> Xexprs and the old esoteric bytes response format. This is backwards
> incompatible change, but I think it will make the server better in the
> long run as it will promote other HTML encodings, like the xml and
> html modules, Eli's new system, SXML, etc. I am interested in your
> opinion.
>
> -- Details --
>
> Everywhere that the server expects a "response" uses the response/c
> contract
>
>
> http://pre.racket-lang.org/docs/html/web-server/http.html#(def._((lib._web-server/http/response-structs..rkt)._response/c))
>
> This allows the native HTTP response data structures, Xexprs, and
> lists that start with bytes (the MIME type) where everything after is
> a byte string or normal string. [I have no idea where that last thing
> came from, but it was in the legacy server and I've kept it
> compatible.]
>
> In addition to backwards incompatibility, this could make Web
> programming a bit more verbose, because you'd have to explicitly call
> "make-xexpr-response" to construct the response from the Xexpr. I
> could ease that a little bit by changing its name to "xexpr" or
> something similar.
>
> Any ideas on the best way to deal with this?
>
> 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
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20101207/46e9f2f8/attachment.html>

Posted on the dev mailing list.