>>>>> "WP" == Walter C Pelissero <email@example.com> writes:
WP> Martin Gasbichler writes:
>> >>>>> "WP" == Walter C Pelissero <firstname.lastname@example.org> writes:
WP> (define-structure program
WP> (export ...)
WP> (open scheme scsh)
>> >> (define (foo args)
>> >> ...)
>> >> (load "source.scm")))
WP> where source.scm makes use of foo.
>> For me, the above code works fine...
WP> I'm sorry. The example was flawed. The load should be inside a
WP> define as in:
WP> (define (bar)
>> (load "source.scm"))
Hmm, I have:
 cat source.scm
(display (foo 32))
 cat test1.scm
(export foo bar)
(open scheme scsh)
(define (foo arg)
(* arg 3))
> ,config ,load test1.scm
> ,open program
Load structure program (y/n)? y
So, I still don't see your problem...
>> But, why do you want to use LOAD at all? Why are you not putting
>> the code of source.scm in a separate module and open PROGRAM in it?
WP> source.scm is a generated source that collects a list of configuration
WP> statements. Anyway I'm not sure I understand what you mean.
WP> Is it something like this you are suggesting?
WP> In, say, modules.scm:
>> (define-structure source
>> (open program)
>> (files source))
WP> and then from my, say, program.scm:
>> (define-structure program
>> (export foo ...)
>> (open scheme scsh source)
>> (begin ...))
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.