Thanks Matthias and Laurent for your advice! I've taken a look at the source code in MrEd designer and understand how dynamic-require works, but have decided against the plugin structure at least for now, since plugin access to a shared database creates other problems - it turned out at a closer look that my plugins would not be as independent and modular than I thought.
Best, Erich MrEd On Tue, 7 Feb 2017 15:20:26 +0000 Laurent <laurent.ors...@gmail.com> wrote: > There's also a plugin system in MrEdDesigner based on the directory > structure to load various widgets at runtime: > https://github.com/Metaxal/MrEd-Designer/blob/master/mred-designer/plugin.rkt > https://github.com/Metaxal/MrEd-Designer/blob/master/mred-designer/mred-plugin.rkt > https://github.com/Metaxal/MrEd-Designer/wiki/Developer%27s-Documentation > > HTH, > Laurent > > On Tue, Feb 7, 2017 at 2:36 PM, Matthias Felleisen > <matth...@ccs.neu.edu> wrote: > > > > > Erich, your needs sound very much like those of DrRacket’s. > > You may wish to study how DrRacket loads tools (as in take > > a look at the source) — Matthias > > > > > > > > > > > > > On Feb 7, 2017, at 9:31 AM, Erich Rast <er...@snafu.de> wrote: > > > > > > Thanks for the advice. So I should use dynamic-require, but how? > > > When I tried to use it like "require" it didn't have the desired > > > effect - nothing was imported. I have to admit I'm struggling a > > > bit with all the different ways of load/eval/require/enter code > > > that I've found in the docs so far. > > > > > > Here is a more concrete example of what I'd like to achieve: > > > > > > (require racket/gui/base > > > gregor > > > (prefix-in internat: "../core/internat.rkt") > > > (prefix-in pref: "../core/prefs.rkt") > > > (prefix-in db: "../core/dbaccess.rkt") > > > (prefix-in dates: "../core/dates.rkt") > > > (prefix-in metafonts: "../core/metafonts.rkt") > > > (prefix-in threaded: "../core/threaded.rkt") > > > (prefix-in console: "console.rkt") > > > "../notetaker/notetaker-main.rkt") > > > > > > I'd like the last require to be dynamic, loaded at runtime from a > > > relative directory and just-in-time compiled or compiled to disk > > > on demand. "notetaker-main.rkt" needs to obtain all definitions > > > from the previous imports (with the prefixes), and the current > > > module needs to obtain notetaker-main.rkt's exports - in this > > > case a 'notes-panel%, for instance. This also needs to work in a > > > compiled application created with "Create > > > Executable ...>Distribution" from the Racket menu. > > > > > > How would I go about that? Is it very complicated? > > > > > > If it's very complicated, maybe I should abandon the idea. But it > > > would be neat, because the main application is really just a tab > > > panel with many independent subcomponents as panel% classes. > > > > > > Best, > > > > > > Erich > > > > > > > > > > > > > > > On Tue, 7 Feb 2017 20:05:03 +0800 > > > WarGrey Gyoudmon Ju <juzhenli...@gmail.com> wrote: > > > > > >> I think you can check the source of `raco` which uses the > > >> `info.rkt` to search all subcommands(see `racket/getinfo`). In > > >> this way, all plugins are just normal packages, you do not have > > >> to reside them is a specific directory. Certainly, the plugin is > > >> loaded via `dynamic-require`, if the plugin needs the imports of > > >> main > > > > > > -- > > > 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. > > > -- 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.