

You can actually also pass a series of files:
consult([foo,roo])
Did you know ... | Search Documentation: |
![]() | Predicate consult/1 |
?- consult(load). | % consult load
or load.pl |
?- [library(lists)]. | % load library lists |
?- [user]. | % Type program on the terminal |
The predicate consult/1
is equivalent to load_files(File, [])
, except for handling
the special file user
, which reads clauses from the
terminal. See also the stream(Input)
option of
load_files/2.
Abbreviation using ?- [file1,file2].
does
not work for the empty list ([]
). This facility is
implemented by defining the list as a predicate. Applications may only
rely on using the list abbreviation at the Prolog toplevel and in
directives.
You can actually also pass a series of files:
consult([foo,roo])
Edge case:
If there are files "roo", "foo", "foo.pl
" and "foo.pl
.pl"
Then
[foo] loads "foo.pl
"
['foo.pl
'] or ["foo.pl
"] also loads "foo.pl
"
['foo.pl
.pl'] loads "foo.pl
.pl"
Loading "foo" is not possible, but
[roo] still load "roo.pl
"
It is only the suffix ".pl" which is proceessed this way. If it's not ".pl", you cannot leave the suffix out in the argument to consult.