Aladdin - Scala Bugtracking
[#941] project: interpreter priority: low category: feature
submitter assigned to status date submitted
Nikolay Lex won't fix 2007-02-11 17:22:15.0
subject [contrib #327] :load should clear all previous definitions
code
First, :load a .scala-file. Then change the signature of a function, and :load again. Now, there's a chance that the new function won't be invocated but the old one instead. This can be confusing and hard to track, and has happened a couple of times to me.
what happened
what expected I hope :load would reset the environment of definitions, or add another command to reset and load.
[back to overview]
Changes of this bug report
Nikolay  edited on  2007-02-11 17:22:45.0
contribution #327
Lex  edited on  2007-02-14 15:33:04.0

New expressions should always use the latest definition of any identifier; if you can find an example where this is not true, then please reopen the bug.

Old definitions use the version of functions, etc., that were current at the time of the definition. Retroactively rebinding old uses of an identifier is very interesting, but is a real challenge in a staticly typed language.

To reload all definitions from scratch, use :replay. Alternatively, make a file that itself has :load commands in it, and :load that file.

There is no command to reset without replaying. For that functionality, you should quit and restart the interpreter.