[racket] racket/place seems to be incompatible with DrRacket

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Aug 30 15:46:55 EDT 2011

DrRacket is naming them. They are named 'anonymous-module and are put
into the current-namespace. (Changing the module-name-resolver in that
manner seems like a bad idea to me -- and modules can exist just
attached to the namespace like that. For example, '#%place is one such
module that you are familiar with.)

One simple-to-fix problem with 'place' was that it was not correctly
handling symbols as module names. I've pushed a fix. (You should
probably look at the commit message for some other, minor comments on
the code.)

One harder-to-fix problem (at least for me) is that dynamic-place does
not handle such modules. I don't know if the fix is to signal an error
or to improve how places are started, but here is an example of how
dynamic-place is being called in this case.

#lang racket

(define ns (make-base-namespace))
(parameterize ([current-namespace ns])
  (eval '(module m racket/base (define (f pc) (printf "hi\n"))))
  (eval '(require 'm))
  (eval '(require racket/place))
  (eval '(dynamic-place ''m 'f)))

This produces this error:

   dynamic-require: unknown module: 'm

which should be unsurprising to you, because the newly created place
doesn't get the module 'm.

A third problem: the error is printed to the original stdout of
DrRacket (which is probably why you and David Mitchell didn't see it).
It would be better if there were some error handling code that
transmitted the exception record (or perhaps just the message field)
back to the original place for rendering there. I'm thinking
specifically in the case that the initial require fails. (I think I've
mentioned this before so if there's some reason I'm missing that keeps
this from being changed, please let me know.)


On Tue, Aug 30, 2011 at 1:32 PM, Kevin Tew <tewk at cs.utah.edu> wrote:
> Place are spawned by dynamically requiring a module.
> It appears that an unsaved module in drracket gets the name
> "anonymous-module" and the module-name-resolver doesn't know how to find
> "anonymous-module".
> I think drracket needs to uniquely name these anonymous-modules and then
> install a
> module-name-resolver that can return the correct anonymous module when
> asked.
> I assume these anonymous modules exist in the drracket environment, just not
> on disk.
> Kevin
> On 08/30/2011 12:12 PM, Robby Findler wrote:
>> Kevin: when I follow the steps exactly as written, I get this error
>> message on stdout (under windows):
>> standard-module-name-resolver: collection not found: "anonymous-module" in
>> any o
>> f: (#<path:C:\Users\robby\AppData\Roaming\Racket\\collects>
>>  #<path:C:\Use
>> rs\robby\git\exp\plt\collects>)
>> I believe this to be a bug in the implementation of 'place' and to
>> have something to do with the name of the source locations that
>> DrRacket uses when the file is not saved.
>> Robby
>> On Tue, Aug 30, 2011 at 12:14 PM, Kevin Tew<tewk at cs.utah.edu>  wrote:
>>> When I run the code below in drracket, the code seems to run
>>> indefinitely.
>>> When I hit the stop button the (place-channel-get p) sexp is highlighted
>>> in
>>> pink.
>>> Kevin
>>> On 08/30/2011 08:54 AM, David Mitchell wrote:
>>> #lang racket
>>> (define (super-simple)
>>>   (define p
>>>     (place ch
>>>            (place-channel-put ch 5)))
>>>   (place-channel-get p))
>>> _________________________________________________
>>>  For list-related administrative tasks:
>>>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.