SWI-Prolog has a mechanism for easy incorporation of community
extensions. See the pack
landing page for details and available packs. This section documents
the built-in predicates to attach packs. Predicates for creating,
registering and installing packs are provided by the library
library(prolog_pack)
.
pack
. The default for this search path is given below. See
file_search_path/2
for the app_data
search path.
user:file_search_path(pack, app_data(pack)).
The default path may be overruled with the environment variable
SWIPL_PACK_PATH
. This variable must contain a list of
directories separated by the OS-specific path_sep.
The predicate attach_packs/0 is called on startup of SWI-Prolog.
last
). Using
first
, new packages are added at the start.warning
, which prints a warning and
ignores the new pack. Other options are keep
, which is like warning
but operates silently and replace
, which detaches the old
pack and attaches the new.true
, unregister all packs before registering the new
packs.
The predicate attach_packs/2
can be used to attach packages that are bundled with an application.
With the option replace(true)
,
attach_packs/2
ensures that the application only relies on bundled packs.