:- [auxiliaries,tools].it behaves like an include/1 directive, i.e. it instructs the compiler (or any other source-processing tool) to process the given files as if they were part of the file containing the directive.
When called as a query (e.g. at the interactive toplevel) or goal, it will compile source files or load precompiled files. If a precompiled file exists (usually characterized by a .eco file suffix), then this file is loaded, otherwise a source file is expected and compiled using compile/1. See the specification of compile/1 for details.
A particular common use at the toplevel is the special form:
?- [user].which is used for interactively compiling code from the standard input.
Success: [hanoi]. % compiles the file hanoi.pl [eclipse]: sh('cat file1'). p:-writeln(hello). yes. [eclipse]: sh('cat file2'). q(X) :- write(X). yes. [eclipse]: [user], p. p :- writeln(hi). user compiled 92 bytes in 0.00 seconds hi yes. [eclipse]: [file1, file2], p. /home/lp/user/file1 compiled 32 bytes in 0.02 seconds /home/lp/user/file2 compiled 92 bytes in 0.00 seconds hello yes. Error: [F]. (Error 4). [file1/1]. (Error 5). [noexist]. (Error 171).