Martin Gasbichler writes:
> So, I still don't see your problem...
I have to confess I haven't been trying the interpreted version. So
here is my test:
hyde259% cat test1.scm
-dm -o program -e main -s
(export foo main)
(open scheme scsh)
(define *stuff* '())
(define (foo x)
(set! *stuff* (cons x *stuff*)))
(define (main args)
hyde260% cat test2.scm
(c b a)
hyde262% make test1
./make-scsh-image.scm test1.scm -lm modules.scm
Error: undefined variable
I begin to suspect the problem might be in make-scsh-image.scm which
(according to the manual) does a simple:
(run (| (begin
(format #t "(dump-scsh-program main \"~a\") (exit)" temp-file))
(scsh ,@args -lm ,source-file -o program))
where args is '(-lm modules.scm) and source-file is test1.scm. Then
"#!/usr/local/lib/scsh/scshvm \\\n-o /usr/local/lib/scsh/scshvm -i\n!#\n"
to fix the header.
> WP> Wouldn't this hard code source.scm in the compiled code? (yes, I'm
> WP> generating scsh images for speed)
> Okay, I see. But the code of source.scm will only be compiled and
> stored in the image if you load/open the module SOURCE before you dump the
> image. Otherwise the compiler will not look into the module's code.
How would you delay the opening of SOURCE?