[gambit-list] bug in gsc -i ?

Bradley Lucier lucier at math.purdue.edu
Mon May 7 06:07:55 EDT 2012


Since no one else has replied yet, the answer is a variant of "it's not a bug, it's a feature".

Google

site:http://mercure.iro.umontreal.ca/pipermail/gambit-list/ define-macro

Brad

On May 5, 2012, at 5:44 PM, Cyrille Duret wrote:

> hello,
> I try to build some basic script wich use external macro with -i switch from gsc and I encounter an annoying error.
> 
> Here is the simple test :
> @ ll
> total 6
> -rw-r--r--  1 cydu  cydu  60 May  5 10:36 build.scm
> -rw-r--r--  1 cydu  cydu  39 May  5 10:36 test-macro.scm
> -rw-r--r--  1 cydu  cydu  55 May  5 10:36 test-simple.scm
> @ more test-macro.scm
> (define-macro (my-macro x)
>   `(+ x 1))
> @ more test-simple.scm
> (define my-func
>   (lambda (x)
>     (+ x (my-macro x))))
> @ more build.scm
> (include "test-macro.scm")
> (compile-file "test-simple.scm")
> @ gsc-gambit -i build.scm
> @ gsi-gambit
> Gambit v4.6.4
> 
> > (load "test-simple")
> *** WARNING -- Variable "my-macro" used in module "test-simple.o1" is undefined
> "/usr/users/cydu/tmp/bug-test/test-simple.o1"
> > 
> *** EOF again to exit
> @ rm test-simple.o1
> @ gsc-gambit             
> Gambit v4.6.4
> 
> > (include "test-macro.scm")
> > (compile-file "test-simple.scm")
> "/usr/users/cydu/tmp/bug-test/test-simple.o1"
> > 
> *** EOF again to exit
> @ gsi-gambit
> Gambit v4.6.4
> 
> > (load "test-simple")            
> "/usr/users/cydu/tmp/bug-test/test-simple.o1"
> > (my-func 3)                     
> 7
> > 
> It fails from the i switch and succeed when I launch gsc and type the commands by myself.
> 
> It seems that the -i switch from gsc does not load the macro when it compile my file.
> Any idea about what might cause that annoying error ?
> 
> thanks a lot
> cyrille
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list



More information about the Gambit-list mailing list