[racket] instantiating multiple sandboxes with gui's

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Apr 6 14:40:27 EDT 2014

This won't work either, unfortunately. The constraint on racket/gui/base
not being instantiated twice holds even across multiple places. You can see
this in DrRacket, for example by writing this program:

#lang racket
(begin-for-syntax
  (dynamic-require 'racket/gui/base #f))

online check syntax chokes with the "cannot instantiate `racket/gui/base' a
second time in the same process" error.

Robby



On Sun, Apr 6, 2014 at 11:40 AM, Spencer florence <spencerflorence at gmail.com
> wrote:

> Annother option is for ,run to spin up a place, and then have the emacs
> repl pass commands over the channel. That should allow GUI to be
> instantiated as much as one wants. Im not sure how passing a "C-c" over to
> the place would work however. C-c could just kill the place, but that would
> come at the cost of loosing the backtrace. Also if emacs were to crash the
> place might not shutdown.
>
>
> On Sun, Apr 6, 2014 at 12:35 PM, Robby Findler <
> robby at eecs.northwestern.edu> wrote:
>
>>
>>
>> On Sunday, April 6, 2014, Greg Hendershott <greghendershott at gmail.com>
>> wrote:
>>
>>> >> How does this handle dynamic and lazy requires?
>>>
>>> It doesn't.
>>>
>>> > Also: how do you know if the cache is stale?
>>>
>>> I don't.
>>>
>>> So my other idea was to do what dynamic-rerequire does and
>>> parameterize current-load/use-compiled, and examine the dependencies.
>>> However in the case where it detects racket/gui/base being loaded for
>>> the first time, it would somehow need to abort the load,
>>> dynamic-require racket/gui/base on the main custodian, then restart
>>> the load as usual. That felt icky, so instead I tried the above, but
>>> if it's the only way to handle dynamic and lazy requires, it's the
>>> only way.
>>>
>>
>> I think you would need to abort the program and start it over to really
>> do that properly.
>>
>> Avoiding the focus shift at the OS level seems easier (altho I don't know
>> if what the right Mac OS X calls to do it are).
>>
>> Robby
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140406/5f95feaf/attachment.html>

Posted on the users mailing list.