[racket-dev] #:namespace

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Mon Oct 4 09:41:03 EDT 2010

It sounds like one could work around this by taking whatever was
passed to #:namespace and making the servlets move over to that
namespace, at least.

Robby

On Mon, Oct 4, 2010 at 8:28 AM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
> I didn't realize the handin server used it when I removed it.
>
> It definitely doesn't need it.
>
> The #:namespace argument made it so the closure given as the request
> handler was called in a different namespace than it was evaluated in,
> causing a reinstantiation of the module and other weirdness. For
> example,
>
> #lang web-server/insta
> (require (only-in "some-stateful-module.rkt" set-a! unbox-a))
> ; where a defaults to "Hello World"
> (set-a! "Hello World, not")
> (define (start req)
>  (unbox-a))
>
> would evaluate to "Hello World" instead of "Hello World, not", because
> some-stateful-module was not shared with the new namespace. This seems
> incredibly wrong, so I removed the namespace argument and the request
> handler closure is simply evaluated in the namespace it came from.
>
> The #:namespace argument is still useful for other servlets that come
> from serve/servlet, because they are loaded from disk and may need to
> share some modules with the main one, but should otherwise be
> isolated.
>
> Jay
>
> On Mon, Oct 4, 2010 at 5:56 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
>> Probably there was some mail on this topic, but...
>>
>> Why did `dispatch/servlet' lose its `#:namespace' argument?
>>
>> The handin server was using that argument, so it no longer runs.
>>
>>
>
>
>
> --
> Jay McCarthy <jay at cs.byu.edu>
> Assistant Professor / Brigham Young University
> http://teammccarthy.org/jay
>
> "The glory of God is Intelligence" - D&C 93
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>


Posted on the dev mailing list.