下面的代码在swi-prolog中工作:
:- asserta(user:file_search_path(money, '/media/D/db')).
dataFile(F) :-
absolute_file_name(money('test.dat'), F, []).
gprolog中似乎没有模块。如何使它在gprolog下工作
真诚!
你没有给出足够的细节,但我推断问题是操作符':-'尝试'初始化/1'
$ cat > file.pl
initialization(asserta(user:file_search_path(money, '/media/D/db'))).
dataFile(F) :- absolute_file_name(money('test.dat'), F, []).
^d
$ gprolog --init-goal "['file.pl']"
compiling /Users/user/file.pl for byte code...
/Users/user/file.pl compiled, 2 lines read - 763 bytes written, 8 ms
GNU Prolog 1.4.1
By Daniel Diaz
Copyright (C) 1999-2012 Daniel Diaz
| ?-