[racket] Stateless servlets and formlets error

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Feb 7 17:24:46 EST 2013

On Wed, Feb 6, 2013 at 9:00 AM, Lorenz Köhl <rainbowtwigs at gmail.com> wrote:
>>> Why does the extra lambda lead to this error message?
>> The answer to the "WHY" is this:
>> 2. If you inline it, or replace the f is send/form2 with
>> 'main-input-formlet', then you are now referring to a global variable,
>> which is never part of closures, because it is always available.
> I see, this is what confused me. Thanks for the explanation.
>> I don't think the benefits are worth it to justify things in the case
>> of formlets, but I'm open to arguments.
> I'll make the formlets toplevel.
> The other problem I have is calling functions from the servlet that use send/suspend and friends, which expect certain continuation marks as I understand it. Is it possible to fake these for a unit test?

Yes... you would want to use call-with-web-prompt from


And it should "just work"

> Another way is to modify make-servlet-tester to not redact the response so I can test other properties like return code and headers. But I'd prefer to do it directly.

I think this would be better to do. We just need to change line 24


to support the stateless mode.

And lines 53-57 to allow you to see the currently un-named part of the
bytes (the .+ in the regexp.)


Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

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

Posted on the users mailing list.