From: Timothy H. <tim...@ma...> - 2002-09-05 02:46:53
|
On Wednesday, September 4, 2002, at 09:23 PM, Ken Anderson wrote: > I think Tim can answer this. Hmmmm. This is a bug in the sense that the compiled and interpreted versions of the code behave differently. However.... I think it is somewhat subtle. The problem arises because the compiler assumes that the only macros it must use to compile the program are the ones that appear in the program itself. I think what you want is some way of specifying that a program (say test.scm) should be compiled using some specified set of macros (e.g. those in macro1.scm). We could modify the compiler to do this, e.g. add a -macro switch, % java jsint.Compile -v -macro mymacro1.scm test.scm and this would be equivalent to adding all macros in mymacro1.scm to the beginning of the test.scm file. Does this seem like a reasonable solution to the problem? ---Tim--- > > At 07:24 PM 9/4/2002, Graham Spencer wrote: >> Hello, >> >> I think I've found a bug in JScheme version 5.0.0. Given the following >> two files: >> >> ;; macro1.scm >> (define-macro (myplus1 a b) >> `(+ ,a ,b)) >> >> ;; macro2.scm >> (load "macro1.scm") >> (define-macro (myplus2 a b) >> `(+ ,a ,b)) >> (.println java.lang.System.out$ (myplus1 1 2)) >> (.println java.lang.System.out$ (myplus2 1 2)) >> >> If I compile both files to .class files and then run jscheme.REPL: >> >> Jscheme 5.0 04/05/2002 http://jscheme.sourceforge.net >> > (load "macro2.scm") >> 3 >> 3 >> #t >> > (macro2.load) >> (+ 1 2) >> 3 >> #null >> >> The (load "macro2.scm") works as expected, but in (macro2.load), the >> macro defined in macro1.scm is expanded but not evaluated. In general, >> I cannot get macros defined in one compiled .class file to work in >> another file. Am I doing something wrong, or is this really a bug? >> >> (My apologies if I should have posted this bug report somewhere else.) >> >> Thanks for your help, >> >> --g >> > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user > |