Auto recourse

Is there a way to define an autorun predicate that will run after a file is downloaded?

Yes, I know about swipl -s file.pl -g "main." but still looking for something that can be put in the source file file.pl

+4
source share
1 answer
 :- initialization(main). 

Make sure the main directive always calls halt/0 , otherwise you will get an excessive level when it fails. Or make an unconditional call to halt/0 :

 :- initialization(once(((main ; true), halt))). 
+6
source

Source: https://habr.com/ru/post/1336695/


All Articles