On Tue, May 12, 2009 at 1:42 PM, Michele Simionato < [email protected]> wrote:
> On Tue, May 12, 2009 at 1:15 PM, Abdulaziz Ghuloum <[email protected]> > wrote: > > I hope this makes it clear so that what Ikarus does is not > > mislabeled "lazy". > > You are saying that Ikarus determines if a library is used or not > statically, > whereas Java does it dynamically at runtime, right? I do not see how > Scheme could do the same, unless we give up phase separation > in macros and we do not want to go that way. > What Aziz is refering to in Java (and .NET) is type initialization. IOW when a type definition's static intializer will run. By default in Java and .NET this will happen the first time that type is referenced at runtime. You cannot call the initializer deterministically. >From what I can see, psyntax/Ikarus runs very close to this model (and I like it as I am used to it). There is 1 surprise though (maybe a bug, probably intended). foo.sls (library (foo) (export foo) (import (rnrs)) (define foo 1)) baz.sls (library (baz) (export foo) (import (rnrs) (foo)) (display 'a) (display 'b) (display 'c)) test.sps (import (rnrs)(baz)) (display foo) This will only print 1 (iow foo) and library (baz) will never be initialized. Cheers leppie -- http://codeplex.com/IronScheme http://xacc.wordpress.com
