[plt-scheme] embedding & modules problem
On Wed, 2009-04-29 at 20:38 -0500, Grant Rettke wrote:
> On Wed, Apr 29, 2009 at 12:26 PM, Ryan Culpepper <ryanc at ccs.neu.edu> wrote:
> > No, they're just different kinds of module paths. The Guide has a section on
> > module paths that describes the differences:
> >
> > http://docs.plt-scheme.org/guide/module-paths.html
>
> FWIW: This is a nice example:
>
> http://docs.plt-scheme.org/guide/contract-boundaries.html#(part._.Experimenting_with_examples)
Thanks, that's clear now.
A related question. Is there a way I can conditionally require from
modules coming from different sources like this? (eq a dynamic linked
extension vs in-source definition) I should explain what I'm trying to
do, as it's probably easier.
I'm creating a version of fluxus where all the binary extensions,
required plt scheme code and libmzscheme (and other libs) are embedded
and statically linked into the application binary - in order that I can
make an easily distributable version for use for a multiplatform game
(with all livecoding features still present btw, as a potential hook to
get people into scheme).
I have all this working, except for a couple of lines in scheme, where I
require the binary extensions using e.g. (require "fluxus-engine.ss")
while in the static linked version I need to call (require
'fluxus-engine) instead - as I am using scheme_primitive_module to
create the module directly in the environment from C++.
I can change these lines by hand, but is there a way to detect the
difference and do the right thing ('if' won't work, but maybe a macro? I
could also get the build script to choose and rename the correct
module .ss file :/ )
I just wondering if there was a better approach entirely...
cheers,
dave