This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 10/26/2011 11:45 AM, Taylor Venable wrote:Hi everybody, another question; this time about importing module fields. [...] Why are test-b and test-c bound to the values they have in Alpha only when running Beta as the main class? How can I get the "right" bindings when running Gamma as the main class? I must be missing something obvious, but I can't figure it out. Thank you for any advice.
Quick answer: compile alpha.scm with --module-static-run or add (module-static 'init-run) to alpha.scm.
Read http://www.gnu.org/software/kawa/Module-classes.html#How-a-module-becomes-a-class
(define (test) (display test-a) (newline) (display test-b) (newline) (display test-c) (newline))
Consider that evaluating the body of alpha.scm means evaluating various expression and performing various initializations/assignments. How should these effects be performed? Obviously, they have to be in some compiler-generated method, but which method, and when and how does this method get invoked? One issue is that if we made --module-init-static run the default (i.e. bodies automatically evaluated when the class is initialized) then you have no way of passing command-line arguments - since the body would be evaluated before main starts.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |