protocol
options_protocol
ï
Options protocol.
logtalk_load(options(loader))
static
Public predicatesï
check_option/1
ï
Succeeds if the option is valid. Throws an error otherwise.
static
check_option(Option)
check_option(@term)
- one_or_error
Option
is a variable:instantiation_error
Option
is neither a variable nor a compound term:type_error(compound,Option)
Option
is a compound term but not a valid option:domain_error(option,Option)
check_options/1
ï
Succeeds if all the options in a list are valid. Throws an error otherwise.
static
check_options(Options)
check_options(@term)
- one_or_error
Options
is a variable:instantiation_error
Options
is neither a variable nor a list:type_error(list,Options)
Option
of the list Options
is a variable:instantiation_error
Option
of the list Options
is neither a variable nor a compound term:type_error(compound,Option)
Option
of the list Options
is a compound term but not a valid option:domain_error(option,Option)
valid_option/1
ï
Succeeds if the option is valid.
static
valid_option(Option)
valid_option(@term)
- zero_or_one
valid_options/1
ï
Succeeds if all the options in a list are valid.
static
valid_options(Options)
valid_options(@term)
- one
default_option/1
ï
Enumerates, by backtracking, the default options.
static
default_option(Option)
default_option(?compound)
- zero_or_more
default_options/1
ï
Returns a list of the default options.
static
default_options(Options)
default_options(-list(compound))
- one
option/2
ï
True iff Option
unifies with the first occurrence of the same option in the Options
list.
static
option(Option,Options)
option(+compound,+list(compound))
- zero_or_one
option/3
ï
True iff Option
unifies with the first occurrence of the same option in the Options
list or, when that is not the case, if Option
unifies with Default
.
static
option(Option,Options,Default)
option(+compound,+list(compound),+compound)
- zero_or_one
Protected predicatesï
merge_options/2
ï
Merges the user options with the default options, returning the final list of options. Calls the fix_options/2
predicate to preprocess the options after merging. Callers must ensure, if required, that the user options are valid.
static
merge_options(UserOptions,Options)
merge_options(+list(compound),-list(compound))
- one
fix_options/2
ï
Fixes a list of options, returning the list of options.
static
fix_options(Options,FixedOptions)
fix_options(+list(compound),-list(compound))
- one
fix_option/2
ï
Fixes an option.
static
fix_option(Option,FixedOption)
fix_option(+compound,-compound)
- zero_or_one
Private predicatesï
(none)
Operatorsï
(none)
See also