In compiling and running the code below (pl_check_input.pl
), I get "user directive failed
" on the ":- initialization..." line
:- dynamic(doit/0).
:- initialization(doit).
:- include(head).
doit :-
readFB(user_input),
writeFB,
halt.
:- include(tail).
$ gplc --no-del-temp --no-top-level pl_check_input.pl
$ ./pl_check_input <fb1 >fb2
warning: /home/tarvydas/Dropbox/Projects/vsh/pl-vsh/pl_check_input.pl:2: user directive failed
If I remove the offending line
:- dynamic(doit/0).
:- include(head).
doit :-
readFB(user_input),
writeFB,
halt.
:- include(tail).
$ gplc --no-del-temp --no-top-level pl_check_input.pl
$ ./pl_check_input <fb1 >fb2
Warning: no initial goal executed
use a directive :- initialization(Goal)
or remove the link option --no-top-level (or --min-bips or --min-size)
Any insights would be very welcome.
Ultimately, I have this code running from the REPL
, but I want to put it in a linux pipeline script and remove the various banner lines that come with top-level/0.