[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [plt-scheme] where to put extensions?

At Sat, 01 Jun 2002 20:56:33 +0200, Sebastian H Seidel wrote:
> If distributing a collection consisting of an extension and
> module^A.ss that depends on module^B that is provided by the
> extension:
> module^A.ss  <==requires==  module^B  <==provided-by==  extension.dll
> a) Where should I put the extension? plt-home? collection-directory?
> b) How can I make module^A load the extension and require module^B?

Good questions. The best apporach I've found is the one used by the
"readline collection:

 *  The extension source, "mzrl.c", is compiled to


    so that `(require (lib "mzrl.so" "readline"))' loads the extension
    --- when it's there.

 *  The "readline" collection also contains an "mzrl.ss" module that
    acts as a placeholder. It exports the same functions as "mzrl.so",
    but reports a "not compiled" error when a function is called.

    As a result, if "mzrl.so" is not yet compiled, then a `(require
    (lib "mzrl.so" "readline"))' loads "mzrl.ss". That's good enough
    for compiling other .zo files before mzrl.c is itself compiled.

    The "readline" collection's "info.ss" indicates that Setup PLT
    should not compile "mzrl.ss" to "mzrl.zo". Otherwise, "mzrl.so" and
    "mzrl.zo" would compete to satisfy `(require (lib "mzrl.so"
    "readline"))' depending on which was compiled most recently.