[plt-scheme] Problem with compiled file dependencies

From: Paulo J. Matos (pocm at soton.ac.uk)
Date: Sat Mar 10 10:00:52 EST 2007

On 3/10/07, Robby Findler <robby.findler at gmail.com> wrote:
> You need to set one of the parameters that tells mz about relative
> paths when doing the compilation, I believe. I'm not sure which one,
> however.
>

By searching the help desk I might imagine the solution is somewhere around:
* (current-load-relative-directory [path])
but I'll still have to do some testing.

> Did you consider just using mzc -k from the commandline to compile the files?
>

Not really because my initial idea was for that the user of my system
could ask for a plugin to be loaded and my system would check if the
file is compiled, if not, it compiles first and loads next. For
compiling during runtime I only found compile-file.

I'll probably have to rethink about the best strategy to follow.
Probably I could just tell users plugins need to be compiled using mzc
before they can be loaded.

> Robby
>
> On 3/10/07, Paulo J. Matos <pocm at soton.ac.uk> wrote:
> > Hello all,
> >
> > I have the following:
> > test/foo.scm
> > (module foo mzscheme
> >   (require "bar.scm")
> >   (provide foo-test)
> >
> >   (define (foo-test x) (bar x)))
> >
> > test/bar.scm
> > (module bar mzscheme
> >
> >   (provide bar)
> >
> >   (define (bar x)
> >     (* 2 x)))
> >
> > Now in interactions:
> > > (require (lib "compile.ss"))
> > > (compile-file "test/foo.scm")
> > #<path:test/compiled/foo.zo>
> > > (dynamic-require "test/compiled/foo.zo" 'foo-test)
> > . open-input-file: cannot open input file:
> > "/home/pmatos/test/compiled/bar.scm" (No such file or directory;
> > errno=2)
> >
> > I understand that bar.scm is not in the same dir as the compiled file.
> > I could just compile the file to the same dir as the bar.scm but I
> > would like to know about other solutions. Any suggestions?
> >
> > Cheers,
> > --
> > Paulo Jorge Matos - pocm at soton.ac.uk
> > http://www.personal.soton.ac.uk/pocm
> > PhD Student @ ECS
> > University of Southampton, UK
> > _________________________________________________
> >   For list-related administrative tasks:
> >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
>
>
>


-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK


Posted on the users mailing list.