Problem with nb_setval/2 and initialization/1

Hi Jan,

the following feels like a bug.

Both tests were done with swipl-win.exe.

File saved_state_1.pl:


test :-

nb_current(test,1).

File saved_state_2.pl:


:-initialization(nb_setval(test,1)).

Both files loaded via consult/1:


Welcome to SWI-Prolog (threaded, 32 bits, version 9.1.8)

...

?- consult('saved_state_1.pl').

true.

?- consult('saved_state_2.pl').

true.

?- test.

true.

Both files loaded via the menu function File → Consult …


Welcome to SWI-Prolog (threaded, 32 bits, version 9.1.8)

...

?-

% d:/prj/swi-prolog/saved_state_1.pl compiled 0.00 sec, 1 clauses

% d:/prj/swi-prolog/saved_state_2.pl compiled 0.00 sec, 1 clauses

?- test.

false. <- **This should be true**

Regards

Holger