If you have control of the language<%> class, then you can do that via the on-execute method. If you want to do that for all languages (which is probably not a good idea, but you could use this approach and limit it to a known set of languages), you could override the on-execute method of the rep<%> object (you can add a mixin). Use this to attach a module to the namespace of the user's program (e.g., #%my-private-state) that has minimal dependencies, and then some library you write would require that module and provide a nice interface, once it gets a hold of that minimal piece of state.
Loggers, as Vincent suggests, might be better (or might be worse), I'm not sure. Robby On Tue, May 16, 2017 at 11:38 AM, 'John Clements' via Racket Users <racket-users@googlegroups.com> wrote: > Austin Sparks (cc:ed) and I are struggling with what I believe should be a > pretty simple problem; how can we share a value between a DrRacket tool and a > user’s program? Specifically, the value in question here is a channel > (probably an asynchronous channel) on which the user’s thread can place > musical-note-to-be-played values. > > The heavyweight way—I’m pretty confident this would work—is to provide our > own “run” button, allowing us to add existing module invocations to the > user’s namespace before the user’s module is expanded or invoked. However, > I’m thinking there’s … an easier way to do it? > > John > > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.