Program name: Difference between revisions

Line 1,310:
 
=={{header|Prolog}}==
<lang Prolog>% SWI-Prolog version 8.0.0 for i686-linux.
% This will find itself, and return the fileknowledge base it is in.
% SWI-Prolog version 8.0.0 for i686-linux
% This will find itself, and return the file it is in.
file_name(F) :- true
, M = user % M is the module .
, P = file_name(_) % P is the predicate .
, source_file(M:P, F) % F is the filenamefile .
, \+ predicate_property(M:P, imported_from(_))
.</lang>
 
</lang>
Alternatively, you may prefer a list of all your knowledge bases; adding the following code to each of your knowledge bases will allow you to query <code>findall(F,source_file(this_is_one_of_my_files,F),L).</code>.
<lang Prolog>:- multifile(this_is_one_of_my_files). this_is_one_of_my_files.</lang>
 
=={{header|PureBasic}}==