Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

swipl: how to reload file

First I load the file with SWI-Prolog

$ swipl file.pl

then I modify the file and save.

Now how do I reload the file like

?- reload

for this modified file.pl?

like image 358
Rahn Avatar asked Nov 30 '16 14:11

Rahn


2 Answers

SWI-Prolog has a predicate make/0 for this purpose:

?- make. 

Note that SWI-Prolog has a handy feature for searching the manual for keywords:

?- apropos(reload). 

Points you (among other things) to Section 3.3 of the manual: "The test-edit-reload cycle", which mentions this.

like image 84
Isabelle Newbie Avatar answered Sep 21 '22 17:09

Isabelle Newbie


Make will reload all source files that have been changed since they were loaded, but if you need to reload an specific file you can use reload_file:

?- make:reload_file(source_file).
like image 33
Rafa Moyano Avatar answered Sep 22 '22 17:09

Rafa Moyano