Author(s): Daniel Cabeza, Mats Carlsson.
Version: 1.11#222 (2004/5/24, 13:8:7 CEST)
Version of last change: 1.7#213 (2002/5/14, 18:11:29 CEST)
Flags define some parameters of the system and control the behavior of system or library predicates. Each flag has a name and an associated predefined value, and except some system flags which are fixed in general their associated value is changeable. Predefined flags in the system are:
version
ciao
(Version
,Patch
). Version
is a floating point number, Patch
is an integer. Unchangeable.
argv
main/1
predicate at executable startup. Unchangeable.
bounded
false
, to denote that the range of integers can be considered infinite (but see
int/1
). Unchangeable. * ISO *
fileerrors
on
, predicates handling files give errors (throw exceptions) when a file is inexistent or an operation is not allowed. If off
, fail in that conditions. Initially on
.
gc
on
(default) or off
.
gc_margin
Margin
. If less than Margin
kilobytes are reclaimed in a garbage collection then the size of the garbage collected area should be increased. Also, no garbage collection is attempted unless the garbage collected area has at least Margin
kilobytes. Initially 500.
gc_trace
[on,off,terse,verbose]
. Initially off
.
integer_rounding_function
toward_zero
, so that -1 =:= -3//2
succeeds. Unchangeable. * ISO *
max_arity
quiet
io_aux
are actually written. As the system uses that library to report its messages, this flag controls the verbosity of the system. Possible states of the flag are:
on
error
warning
off
debug
unknown
error
existence_error(procedure, F/A)
.
fail
warning
error
. * ISO *
prolog_flags
)prolog_flags
)
set_prolog_flag(FlagName, Value)
Set existing flag FlagName
to Value
.
Usage: * ISO *
FlagName
is an atom.
(basic_props:atm/1
)
Value
is any term.
(basic_props:term/1
)
current_prolog_flag(FlagName, Value)
FlagName
is an existing flag and Value
is the value currently associated with it.
Usage: * ISO *
FlagName
is an atom.
(basic_props:atm/1
)
Value
is any term.
(basic_props:term/1
)
FlagName
is an atom.
(basic_props:atm/1
)
Value
is any term.
(basic_props:term/1
)
prolog_flag(FlagName, OldValue, NewValue)
FlagName
is an existing flag, unify OldValue
with the value associated with it, and set it to new value NewValue
.
Usage 1:
FlagName
is an atom.
(basic_props:atm/1
)
OldValue
is any term.
(basic_props:term/1
)
NewValue
is any term.
(basic_props:term/1
)
FlagName
is an atom.
(basic_props:atm/1
)
OldValue
is any term.
(basic_props:term/1
)
Usage 2: prolog_flag(FlagName, OldValue, NewValue)
current_prolog_flag(FlagName
, OldValue
)
OldValue
is a free variable.
(term_typing:var/1
)
NewValue
is a free variable.
(term_typing:var/1
)
FlagName
is an atom.
(basic_props:atm/1
)
The terms OldValue
and NewValue
are strictly identical.
(term_compare:== /2
)
push_prolog_flag(Flag, NewValue)
Same as
set_prolog_flag/2
, but storing current value of Flag
to restore it with
pop_prolog_flag/1
.
Usage:
Flag
is an atom.
(basic_props:atm/1
)
NewValue
is any term.
(basic_props:term/1
)
pop_prolog_flag(Flag)
Restore the value of Flag
previous to the last non-canceled
push_prolog_flag/2
on it.
Usage:
Flag
is an atom.
(basic_props:atm/1
)
prompt(Old, New)
Unify Old
with the current prompt for reading, change it to New
.
Usage 1:
Old
is an atom.
(basic_props:atm/1
)
New
is an atom.
(basic_props:atm/1
)
Old
is an atom.
(basic_props:atm/1
)
Usage 2: prompt(Old, New)
Old
with the current prompt for reading without changing it.
Old
is a free variable.
(term_typing:var/1
)
New
is a free variable.
(term_typing:var/1
)
The terms Old
and New
are strictly identical.
(term_compare:== /2
)
Old
is an atom.
(basic_props:atm/1
)
New
is an atom.
(basic_props:atm/1
)
Usage:
set_prolog_flag(gc, on)
Usage:
set_prolog_flag(gc, off)
Usage:
set_prolog_flag(fileerrors, on)
Usage:
set_prolog_flag(fileerrors, off)
prolog_flags
)
define_flag(Flag, Values, Default)
New flags can be defined by writing facts of this predicate. Flag
is the name of the new flag, Values
defines the posible values for the flag (see below) and Default
defines the predefined value associated with the flag (which should be compatible with Values
).
The predicate is multifile.
Usage 1: define_flag(Flag, ==(atom), Default)
:- multifile define_flag/3. define_flag(tmpdir, atom, '/tmp').
Flag
is a free variable.
(term_typing:var/1
)
Default
is a free variable.
(term_typing:var/1
)
Flag
is an atom.
(basic_props:atm/1
)
Default
is an atom.
(basic_props:atm/1
)
Usage 2: define_flag(Flag, ==(integer), Default)
:- multifile define_flag/3. define_flag(max_connections, integer, 10).
Flag
is a free variable.
(term_typing:var/1
)
Default
is a free variable.
(term_typing:var/1
)
Flag
is an atom.
(basic_props:atm/1
)
Default
is an integer.
(basic_props:int/1
)
Usage 3: define_flag(atm, list(Values), Default)
Values
.
Example:
:- multifile define_flag/3. define_flag(debug, [on,debug,trace,off], off).
Default
is an element of Values
.
(basic_props:member/2
)
Go to the first, previous, next, last section, table of contents.