I'm trying to keep my Prolog code modular, and I was wondering if anyone had any advice as to how to do this. The way I was doing this with simple consult
s, but that is getting cumbersome as the number of my files increase and succumbs to name clashes. Is there any construct similar to that of a "typical" import, such as
%-------------------------------------------------------------------- compiler.pl
[ scanner, parser, codegen ] .
%-------------------------------------------------------------------- compile
% compile( S, I ) :- Compiling the source string S gives the list of instructions
% I
compile( S, I ) :- scan( S, T ), parse( T, A ), codegen( A, I ) .
%-------------------------------------------------------------------------------%
at the top of a source file? If it is program specific, I'm using gprolog
. Thanks in advance for any help.