Logtalk built-in predicate: logtalk_load/1

contents > reference manual > built-in predicates

## `logtalk_load/1`

#### Description

>     logtalk_load(Entity)
>     logtalk_load(Entities)

> Compiles to disk and then loads to memory an entity or a list of entities (objects, protocols or categories) using the default compiler options specified in the Logtalk configuration file. The Logtalk file name extension (by default, `.lgt`) should be omitted. Note that the argument is a list of entity/file names, not file paths. In other words, the files must exist in your current working directory.

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

#### Template and modes

>     logtalk_load(@atom_or_atom_list)

#### Errors

> Entity is a variable:
>   `instantiation_error`
> Entities is a variable or a list with an element which is a variable:
>   `instantiation_error`
> Entities is neither a variable nor an atom nor a proper list:
>   `type_error(list, Entities)`
> An element Entity of the Entities list is neither a variable nor an atom:
>   `type_error(atom, Entity)`
> Entity or an element Entity of the Entities list does not exist in the current working directory:
>   `existence_error(entity, Entity)`

#### Examples

>     | ?- logtalk_load(tree).

>     | ?- logtalk_load([listp, list]).

previous | glossary | next
Copyright © Paulo Moura — Logtalk.org