[ ECLiPSe Predicate Database built-in.|Group Index| Full Index]

set_flag(+PredSpec, +Flag, +Value)

Sets the flag Flag of the procedure specified by PredSpec to the value Value.

+PredSpec
Expression of the form Atom/Integer or a list of those.
+Flag
Atom.
+Value
Atom.

Description

Used to set the value Value of the flag Flag of the procedure(s) specified by PredSpec. The value of a flag may be returned using get_flag/3.

The settable flags, their values and their meanings are:

   --------------------------------------------------
   | Flags       Values     Description             |
   |----------------------------------------------- |
   | leash       stop,      see below               |
   |             print,                             |
   |             notrace                            |
   | skip        on, off    procedure will be       |
   |                        traced, but its         |
   |                        children will not       |
   | spy         on, off    procedure has a         |
   |                        spypoint                |
   | statistics  on, off    procedure profiling     |
   | waking      eager,     waking when suspended   |
   |             lazy                               |
   | parallel    on, off    may be executed in      |
   |                        parallel                |
   --------------------------------------------------
The possible values of leash and their meanings are:

   |-------------------------------------------------|
   | Values      Description                         |
   |-----------------------------------------------  |
   | stop        the procedure's ports will be       |
   |             printed and debugger stops on       |
   |             them                                |
   | print       the procedure's ports will be       |
   |             printed and debugger does not       |
   |             stop on them                        |
   | notrace     the procedure's ports will not be   |
   |             shown, but its children's will      |
   --------------------------------------------------|

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
At least one of PredSpec, Flag or Value are not instantiated
(5) Type error
PredSpec is not an expression of the form Atom/Integer.
(5) Type error
Flag is not an atom.
(5) Type error
Value is not an atom.
(6) Range error
Flag is no flag.
(6) Range error
Value is no value of the flag Flag.
(30)
Flag is a read only flag.
(60)
PredSpec is not defined.

Examples


Success:
    [eclipse]: [user].
     pr([]).  % prints the elements of a list
     pr([ S | T ]) :-
            writeln(S),
            pr(T).
     user compiled 484 bytes in 0.00 seconds
    yes.
    [eclipse]: pr([tom, dick]).
    tom
    dick
    yes.
    [eclipse]: set_flag(pr/1, spy, on).
    yes.
    [eclipse]: trace.
    Debugger switched on - creep mode
    yes.
    [eclipse]: pr([tom, dick]).
     +(1) 0  CALL   pr([tom, dick]) (dbg)?- leap
    tom
     +(3) 1  CALL   pr([dick]) (dbg)?- leap
    dick
     +(5) 2  CALL   pr([]) (dbg)?- leap
     +(5) 2  EXIT   pr([]) (dbg)?- leap
     +(3) 1  EXIT   pr([dick]) (dbg)?- leap
     +(1) 0  EXIT   pr([tom, dick]) (dbg)?- leap
    yes.

Error:
    set_flag(X, skip, on).                 (Error 4).
    set_flag("a", spy, on).                (Error 5).
    set_flag(is/2, spy, yes).              (Error 6).
    set_flag(p/2, leash, on).              (Error 60).


See Also

debug / 0, get_flag / 3, nospy / 1, parallel / 1, pred / 1, skipped / 1, spy / 1, trace / 0, traceable / 1, unskipped / 1, untraceable / 1