How to run SWI-Prolog from the command line?
ISO directive: initialization. This should work. :- initialization main. main :- write(‘Hello World\n’). edit sorry, I skipped over most interesting details. Here is a sample script, let’s say saved in ~/test/main.pl #!/home/carlo/bin/swipl -f -q :- initialization main. main :- current_prolog_flag(argv, Argv), format(‘Hello World, argv:~w\n’, [Argv]), halt(0). and made executable with chmod +x ~/test/main.pl then I … Read more