circular loading

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

circular loading

fschmidt
Administrator
If module m1 requires m2 and m2 requires m1, then I get a StackOverflowError.
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: circular loading

fschmidt
Administrator
Lua has the same problem.

fixed in rev 328.  Now the _ENV of a module is put in Package.loaded before the module is run.  And if there is an error, everything is cleaned up and returned to its prior state.  closing
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture
Reply | Threaded
Open this post in threaded view
|

Re: circular loading

fschmidt
Administrator
I changed my mind on this.  Handling circular loading can introduce subtle bugs.  Better to just fail and have the programmer handle this manually.  So I reverted this change.
Woe to those who call bad good and good bad -- Isaiah 5:20
Following the Old Testament, not evil modern culture