Got it. Thanks Marc!
Regards,
Kashyap

On Fri, Jan 27, 2017 at 6:27 AM, Marc Feeley <feeley@iro.umontreal.ca> wrote:
The order is important.  The Gambit linker (part of gsc) will ensure that the execution of each file's body will be sequenced in the same way as the order of the files on the command line.  So after

   gsc -o out -exe f1.scm f2.scm

executing out will have the same effect as doing

   (load "f1.scm")
   (load "f2.scm")

in the interpreter except that the code will be compiled rather than interpreted.  In many cases the files that compose a program have dependencies and it is important for gsc to obey they ordering so the programmer has some way to specify an order.

Marc


> On Jan 27, 2017, at 9:18 AM, C K Kashyap <ckkashyap@gmail.com> wrote:
>
> Hi,
> Here's an observation that I have -
>
> I have "f1.scm" that defines a function f1 and f2.scm that defines f2 (which calls f1)
>
> 1. If I do gsc -o out -exe f1.scm f2.scm - out gets generated but I get the error unbound2/operator not a procedure
>
> 2. However, if I do gsc -out f2.scm f1.scm, things work fine
>
> So my question is, is that expected as in, I must ensure that the list of files are in the right order (in terms of dependencies)? or am I missing some option?
>
> Also, I'd appreciate some pointers to using definitions from another file - I found (##include) - is that the way to go?
>
> Regards,
> Kashyap
> _______________________________________________
> Gambit-list mailing list
> Gambit-list@iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list