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
The exception code associated with a context error is
context_error(Goal, ContextType, CommandType)
Some ContextTypes recognized by the system include:
'pseudo-file ''user'''-- for pseudo-file
if-- inside an if
bof-- at beginning of file
bom-- at beginning of module
query-- in query
'after clauses'-- after clauses
'not multifile and defined'-- for defined, non-multifile procedure
'static multifile'-- for static multifile procedure.
)-- for language L.
file_load-- during load of file(s).
started-- started up
notoplevel-- when no top level
Some CommandTypes recognized by the system include:
0-- no commandtype specified
)-- meta_predicate declaration for M
)-- Invalid argument specification A
foreign_file/2declaration for File
foreign/3declaration for F
(initialization)-- initialization hook
abort-- call to