create_logtalk_flag/3¶
Description¶
create_logtalk_flag(Flag, Value, Options)
Creates a new Logtalk flag and sets its default value. User-defined flags can be queried and set in the same way as pre-defined flags by using, respectively, the current_logtalk_flag/2 and set_logtalk_flag/2 built-in predicates.
This predicate is based on the specification of the SWI-Prolog
create_prolog_flag/3 built-in predicate and supports the same
options: access(Access), where Access can be either
read_write (the default) or read_only; keep(Keep), where
Keep can be either false (the default) or true, for deciding
if an existing definition of the flag should be kept or replaced by the
new one; and type(Type) for specifying the type of the flag, which
can be boolean, atom, integer, float, or term (which
only restricts the flag value to ground terms). When the type/1
option is not specified, the type of the flag is inferred from its
initial value.
Modes and number of proofs¶
create_logtalk_flag(+atom, +ground, +list(ground)) - one
Errors¶
instantiation_errorinstantiation_errorinstantiation_errortype_error(atom, Flag)type_error(atom, Flag)domain_error(flag_value, Flag + Value)permission_error(modify, flag, Flag)Examples¶
% create a new booloean flag with default value set to false:
| ?- create_logtalk_flag(pretty_print_blobs, false, []).
See also