Context Errors

A context error occurs when a goal or declaration appears in the wrong place. There may or may not be anything wrong with the goal or declaration as such; the point is that it is out of place. Calling multifile/1 as a goal is a context error, as is having :-module/2 anywhere but as the first term in a source file.

The exception code associated with a context error is

     context_error(Goal, ContextType, CommandType)

the context in which the command was attempted.

Some ContextTypes recognized by the system include:

the type of command that was attempted.

Some CommandTypes recognized by the system include: