SWI Prolog allows the execution of a goal before top level with non zero arity as follows
swipl -s consultingfile.pl -g start
however when a predicate with non zero arity is specified as follows
swipl -s consultingfile.pl -g start(1)
It gives an error
syntax error near unexpected token '('
What should be done to pass a non-zero arity predicate as a goal before top level?
I think this has nothing/not much to do with SWI-prolog itself, but more with the command line handler.
If I place the goal between single quotes (
''
), it works:The brackets are probably wrongly interpreted by the shell.
If I use your command it gives:
Mind however the
bash
before the colon. That means control is never really given toswipl
, it is bash that complains about the brackets.In general it is better to put items into quotes in order to group content as a single parameter.