开发者

Autorun predicate

Is there a way to define autorun predicate, which will run after loading a file?

Yeah, I know about swipl -s fil开发者_Go百科e.pl -g "main.", but still looking for something, which can be put in source file file.pl


:- initialization(main).

Make sure the main directive always calls halt/0, else you will get a toplevel when it fails. Or put in an unconditional call to halt/0:

:- initialization(once(((main ; true), halt))).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜