PLOGHELP CONSULT                                Robert Duncan, July 1993

Reading procedure definitions from a file.

    ?- consult(Files).


consult/1 reads clauses and executes directives from a set of Files.
When a clause is read, it is added to the database after any clauses
which already exist for that procedure. When a directive is read, it is
executed immediately.

Files can be a single filename or a list of filenames to be consulted in
order. Each filename must be an atom. If there is no file with the given
name, and the name has no extension, consult/1 will append the standard
Prolog file extension '.pl' to the name and try reading from that. Thus
if there is no existing file called 'program', the goal

    ?- consult(program).

can be used as shorthand for the goal

    ?- consult('program.pl').

If the special file 'user' is specified, clauses and goals will be read
from the terminal; Prolog will prompt with a '| ' in this case. Terminal
input can be terminated with the usual end-of-file indicator.

A shorthand form of consult/1 uses the list notation:

    ?- [File|Files].

which is identical to

    ?- consult([File|Files]).

consult/1 is itself an abbreviation for a call to the compiler in
consult mode: for full details see PLOGHELP * COMPILE.


--- C.all/plog/help/consult
--- Copyright University of Sussex 1993. All rights reserved.
