PublicShow sourcesettings.pl -- Setting management

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.

author
- 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 convert_setting_text(Arg1, Arg2, Arg3)
Source list_settings(Arg1)
Source setting_property(Arg1, Arg2)
Source load_settings(Arg1)
Source load_settings(Arg1, Arg2)
Source save_settings
Source save_settings(Arg1)
Source set_setting_default(Arg1, Arg2)
Source setting(Arg1, Arg2, Arg3, Arg4)
Source setting(Arg1, Arg2)
Source set_setting(Arg1, Arg2)
Source restore_setting(Arg1)
Source current_setting(Arg1)
Source list_settings