logtalk_load/2

Description

logtalk_load(Entity, Flags)
logtalk_load(Entities, Flags)

Compiles to disk and then loads to memory an entity, a list of entities (objects, protocols or categories), or a source metafile using a list of flag values. The Logtalk file name extension (by default, .lgt for entity source files and .mlgt for source metafiles) should be omitted. Note that the first argument is a list of entity/file names, not file paths. In other words, the files must exist in the current working directory.

For a description of the available compiler flags, please consult the User Manual.

Note that only the errors related to problems in the predicate arguments are listed below. Other exceptions may be thrown by the compiler if any of the loaded entities contains syntax errors.

Template and modes

logtalk_load(@entity_file_name, @list)
logtalk_load(@entity_file_name_list, @list)

Errors

Entity is a variable:
instantiation_error
Entities is a variable or a list with an element which is a variable:
instantiation_error
Entity, or an element Entity of the Entities list, is neither a variable nor an entity file name nor a library entity file name:
type_error(entity_file_name, Entity)
Entity, or an element Entity of the Entities list, is a compound term but not a library entity file name:
type_error(library_entity_file_name, Entity)
Entity or an element Entity of the Entities list does not exist in the current working directory or in the specified library directory:
existence_error(entity, Entity)
Entity library does not exist:
existence_error(library, Library)
Flags is a variable:
instantiation_error
Flags is neither a variable nor a proper list:
type_error(list, Flags)
An element Flag of the Flags list is not valid:
type_error(compiler_flag, Flag)

Examples

| ?- logtalk_load(list, []).

| ?- logtalk_load(types(tree), [xmlspec(xsd)]).

| ?- logtalk_load([listp, list], [xml(off), plredf(warning)]).