SWI-prolog, runtime, how-to

From: Will Briggs (briggs_w_at_yahoo.com)
Date: 04/13/04


Date: 13 Apr 2004 09:33:26 -0700

Sorry, I tried a different search term after posting my query (which I
can't make this a reply to on Google groups). Here was the answer:

main :-
|> unix(argv(Argv)), % still Quintus compatibility
|> append(_, [--|AppArgs], Argv), !,
|> parse(AppArgs),
|> halt.
|>
|> parse(Argv) :-
|> format('Called with argv ~w~n', [Argv]).

|> % pl -o test -f none -g main -c load.pl
|> load.pl compiled, 0.00 sec, 1,312 bytes.
|> /staff/jan/lib/pl-3.2.8/library/quintus compiled into quintus,
|> 0.00 sec, 9,792 bytes.
|> % ./test hello world
|> Called with argv [hello, world]
|> %

from http://groups.google.com/groups?q=swi-prolog+executable&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=7kv9jp%245rr%40news-rocq.inria.fr&rnum=1