From: Timothy H. <tim...@ma...> - 2002-09-05 21:16:54
|
On Thursday, September 5, 2002, at 04:55 PM, Graham Spencer wrote: > Timothy Hickey wrote: > > > We could also automatically compile macro1.scm when the (load > > "macro1.scm") expression is compiled in macro2.scm or we could just > > scan through it and pull out the macro definitions..... > > I like this sort of approach better than an include statement because > it means that as a user of a library, I don't have to remember which > definitions are functions and which are macros. If macros and functions > are handled differently, then a library provider would have to create > two separate files so that the user could do: > > (include "mylib-macros.scm") > (load "mylib.scm") > > Ideally, the macro definitions would be saved in the java file so that > they would work even if the user was loading a compiled .class file, > e.g. (mylib.load). This would guarantee that (load "mylib.scm") and > (mylib.load) always had the same semantics. It would also allow JScheme > libraries to be distributed as .class/.jar files. This is an interesting point. It would be nice to be able to distribute libraries as class files and to have (load F.scm) be equivalent to (F.load). but this suggests that the compiled class should provide a way of accessing the defined macros so that the compiler can extract the macros from the .class file as easily as from the .scm file, e.g. (F.getMacros) could return a hashtable containing the macros defined in the Swing.scm library. ---Tim--- |