[ Directives | The ECLiPSe Built-In Predicates | Reference Manual | Alphabetic Index ]


Enable or disable compiler options. Can only be used as a directive in source files.
An atom.


The pragma/1 directive allows to control various compiler options. The effect of a pragma is local to a source file (unlike set_flag/2). Settings are in effect until the next pragma that overrides it or until the end of the file.
    Option     Effect
    debug      debuggable code, no inline compilation
    nodebug    non-debuggable code, inline compilation done
    skip       set the skipped flag for all compiled predicates
    noskip     don't (default)
    expand     do inline compilation
    noexpand   don't
    system     set the type of all compiled predicates to built_in
The default for debug/nodebug depends on the global flag debug_compile. The default for expand/noexpand depends on the global flag goal_expansion. The global flags are set with set_flag/2 and tested with get_flag/2.

Pragmas which the compiler does not recognise are silently ignored by the compiler, but are recorded and can be retrieved using current_pragma/1. Such pragmas can be atoms or structures with arbitrary arguments.

Modes and Determinism


(148) bad pragma
An unknown Option was given.


:- pragma(debug).
:- pragma(expand).
twice(X, Y) :-      % this is compiled into debuggable
    Y is 2*X.       % code with expanded arithmetic

See Also

compile / 1, env / 0, get_flag / 2, get_flag / 3, pred / 1, set_flag / 3, set_flag / 2, skipped / 1, unskipped / 1, current_pragma / 1