【发布时间】:2020-02-22 12:50:49
【问题描述】:
给定代码 a2.pl:
%% prolog (swipl) command line arguments
%% swipl -s a2.pl -t a --quiet -- "b" "c" "D"
%% which outputs to screen: ['D']
writeln1(Term) :-
term_to_atom(Term,Atom),
writeln(Atom),!.
a:-
current_prolog_flag(argv, AllArgs),
AllArgs=[_,_ | Args],
writeln1(Args),halt.
如何查询swipl -s a2.pl -t a --quiet "b" "c" "[[v,b],":-",[[[n,=]]]]"
返回
['[[v,b],:-,[[[n,=]]]]']
返回
[[v,b],":-",[[[n,=]]]]
?
【问题讨论】:
标签: arguments command line quotes swi-prolog