Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module is not loaded on second try #29

Closed
cdupont opened this issue Mar 7, 2017 · 1 comment
Closed

Module is not loaded on second try #29

cdupont opened this issue Mar 7, 2017 · 1 comment

Comments

@cdupont
Copy link
Contributor

cdupont commented Mar 7, 2017

I have this error:

Not Allowed:
module is not loaded: ‘Bar’ (Bar.hs)

This happens after I load another module (say 'Foo'), reset the interpreter, then load Bar.
If I load Bar first, then it works.
Any idea?

My code for the interpreter is here:
https://github.com/cdupont/Nomyx/blob/master/Nomyx-Core/src/Nomyx/Core/Engine/Interpret.hs

You can see that the same interpreter is kept between two sessions (call to "interpretRule" function), but I reset it each time.

Here are my traces:

[2017-03-07 10:58:50 CET : Nomyx.Core.Engine.Interpret : INFO] Loading modules: Foo.hs
[2017-03-07 10:58:50 CET : Nomyx.Core.Engine.Interpret : INFO] module names: Foo

-> at this point, Foo is used successfully
-> interpreter is RESET

[2017-03-07 10:58:56 CET : Nomyx.Core.Engine.Interpret : INFO] Loading modules: Bar.hs
[2017-03-07 10:58:56 CET : Nomyx.Core.Engine.Interpret : INFO] module names: Bar
[2017-03-07 10:58:56 CET : Nomyx.Core.Session : WARNING] Not Allowed: module is not loaded: ‘Foo’ (Foo.hs)

As you can see, the engine is reset, but then it fails, referencing a module that should not exist anymore.

@cdupont
Copy link
Contributor Author

cdupont commented Mar 7, 2017

Oops, found the bug, it was on my side.
I was doing a setImportsQ on the wrong module (namely Foo in the example).
That triggered the exception.

@cdupont cdupont closed this as completed Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant