Ask Your Question
3

Do I need to re-import in console after changing an imported module?

asked Nov 15 '11

Johanneke gravatar image Johanneke
77 4 10

updated Nov 16 '11

PaulKlint gravatar image PaulKlint flag of Netherlands
373 5 16 33
http://www.cwi.nl/~paulk

So, after I've changed a .rsc file in eclipse and I want to test my changes in the console, do I have to import the module again?

delete close flag offensive retag edit

3 Answers

Sort by ยป oldest newest most voted
3

answered Nov 15 '11

PaulKlint gravatar image PaulKlint flag of Netherlands
373 5 16 33
http://www.cwi.nl/~paulk

updated Nov 15 '11

No, modules are imported automatically after every change.

In the current release this seems to be working fine, but in older versions this did not always work as expected (in particular when changing a module that was only indirectly imported in the console session).

Hence: no you don't have to reload manually after a change. Only in case of doubt you may want to reload manually.

link delete flag offensive edit
1

answered Nov 16 '11

DavyLandman gravatar image DavyLandman flag of Netherlands
267 4 17
http://homepages.cwi.nl/~...

updated Nov 16 '11

PaulKlint gravatar image PaulKlint flag of Netherlands
373 5 16 33
http://www.cwi.nl/~paulk

While Paul's answer is almost correct, this does not hold if you've introduced a parsing error into your module. Than the old version of the module is used.

While some parse errors are visible by the red squiggly line in the editor, some problems such as those with function declarations with patterns as parameters are only shown after an explicit import statement.

So in case that the results of a re-run of the method does not change as you intended, try to import your module again and see if that reports any errors.

link delete flag offensive edit

Comments

Ah, that would explain my "sometimes it works, sometimes it doesn't" situation. Thank you :)

Johanneke (Nov 16 '11)edit

Thanks Davy for this addition!

PaulKlint (Nov 16 '11)edit

Ah, so thats the reason! Theres an easy fix for that i think, such that the implicit import at least shows the errors.

JurgenVinju (Nov 16 '11)edit

yes that would be the solution :)

DavyLandman (Nov 16 '11)edit
0

answered Jan 24

Hossein gravatar image Hossein
81 8 20

Over my recent Rascal development time, it happened several times that I changed a piece of my code, and even reimported it manually, but Rascal simply didn't notice the change! I had to restart my Eclipse to get Rascal finally reflect the change. There was nothing for me to log AFAIK except that I could have perhaps filmed the event. Whilst I couldn't think of this by that time, my supervisor also witnessed it.

link delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]
Also see the Rascal Tutor.

Question tools

Follow

subscribe to rss feed

Stats

Asked: Nov 15 '11

Seen: 34 times

Last updated: Jan 24