Did you know ... Search Documentation:
settings.pl -- Setting management
PublicShow source

This library allows management of configuration settings for Prolog applications. Applications define settings in one or multiple files using the directive setting/4 as illustrated below:

:- use_module(library(settings)).

:- setting(version, atom,   '1.0', 'Current version').
:- setting(timeout, number,    20, 'Timeout in seconds').

The directive is subject to term_expansion/2, which guarantees proper synchronisation of the database if source-files are reloaded. This implies it is not possible to call setting/4 as a predicate.

Settings are local to a module. This implies they are defined in a two-level namespace. Managing settings per module greatly simplifies assembling large applications from multiple modules that configuration through settings. This settings management library ensures proper access, loading and saving of settings.

- Jan Wielemaker
See also
- library(config) distributed with XPCE provides an alternative aimed at graphical applications.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source list_settings(Arg1)
Source convert_setting_text(Arg1, Arg2, Arg3)
Source save_settings(Arg1)
Source current_setting(Arg1)
Source setting_property(Arg1, Arg2)
Source list_settings
Source restore_setting(Arg1)
Source load_settings(Arg1)
Source save_settings
Source load_settings(Arg1, Arg2)
Source set_setting_default(Arg1, Arg2)
Source set_setting(Arg1, Arg2)
Source setting(Arg1, Arg2)
Source setting(Arg1, Arg2, Arg3, Arg4)