Running two instances of swipl on Windows 10 at the same time. One has the original code that works and the other I am using with modified code.
Since the test are identical and predicates are almost identical running a test in the wrong instance can sometimes cause a loss of time because I mistakenly believe a modified predicate passed a test and in fact did not because I ran the test in the wrong instance.
So my quick and simple way to resolve this was to add a this/1 fact to each source code file.
?- this(X).
X = original.
?- this(X).
Correct to: "a_module:this(X)"? yes
X = modifying.
Other ideas I looked at to see if they already existed were
A Prolog flag expecting something to identify the source code file name.
A command line option that would modify the Windows title bar running swipl, but in doing a summary skim of the documentation did not see anything that could work, but could have missed something.
Changing the background color.
The solution that would be nicest is to just have the name of the file or the value of this/1 automatically added to the title bar.
Any one else doing something quick and easy to distinguish multiple instances of swipl?
The current way I start swipl is by clicking on an icon in the task bar which invokes
Let’s assume you have a pristine.pl Prolog file defining a pristine module with the working code and a modified.pl Prolog file defining a modified module with the modified code. You can load both without conflict using:
The module: ?- prompt makes it clear the context as you asked.
Assuming a common set of tests, we can apply them to both modules to compare results. You should be able to call run_tests/0 working from within each module. If not, Logtalk’s lgtunit provides an alternative. In a tests.lgt file:
The lgtunit tool supports multiple test dialects, including one that should make porting your tests (I assume written using plunit) simple if not trivial. To run the tests: