
settings.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.
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.
convert_setting_text(Arg1, Arg2, Arg3)
list_settings(Arg1)
setting_property(Arg1, Arg2)
load_settings(Arg1)
load_settings(Arg1, Arg2)
save_settings
save_settings(Arg1)
set_setting_default(Arg1, Arg2)
setting(Arg1, Arg2, Arg3, Arg4)
setting(Arg1, Arg2)
set_setting(Arg1, Arg2)
restore_setting(Arg1)
current_setting(Arg1)
list_settings