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.

Reply via email to