Next: , Previous: , Up: mpg-bpr   [Contents][Index]


11.3.125 multifile/1   declaration, ISO

Synopsis

:- multifile +PredSpecs

Declares the clauses of the predicates defined by PredSpecs to be multifile in the source file (suppresses compile-time warnings).

Arguments

:PredSpecs

pred_spec_forest, must be ground

A predicate specification, or a list of such, or a sequence of such separated by commas.

Description

By default, all clauses for a predicate are expected to come from just one file. This assists with reloading and debugging of code. Declaring a predicate multifile means that its clauses can be spread across several different files. This is independent of whether or not the predicate is declared dynamic.

Should precede all the clauses for the specified predicates in the file.

There should be a multifile declaration for a predicate P in every file that contains clauses for P. If a multifile predicate is dynamic, then there should be a dynamic declaration in every file containing clauses for the predicate.

When a file containing clauses for a multifile predicate (P) is reloaded, the clauses for P that previously came from that file are removed. Then the new clauses for P (which may be the same as the old ones) are added to the end of the definition of the multifile predicate.

If a multifile declaration is found for a predicate that has already been defined in another file (without a multifile declaration), then this is considered to be a redefinition of that predicate. Normally this will result in a multiple-definition style-check warning (see style_check/1).

The predicate source_file/2 can be used to find all the files containing clauses for a multifile predicate.

Comments

multifile is not an ISO predefined prefix operator.

Exceptions

Exceptions in the context of loading code are printed as error messages.

instantiation_error

PredSpecs not ground.

type_error

PredSpecs not a valid pred_spec_forest.

domain_error

Some arity is an integer < 0.

representation_error

Some arity is an integer > 255.

context_error

Declaration appeared in a goal.

permission_error

Declaration appeared as a clause.

See Also

Multifile Declarations.



Send feedback on this subject.