fix documentation of expand_term/2

This commit is contained in:
Vítor Santos Costa 2011-04-22 13:35:02 +01:00
parent c940245182
commit d3388ed9b4

View File

@ -6687,14 +6687,11 @@ Grammar related built-in predicates:
@table @code @table @code
@item @var{CurrentModule}:expand_term(@var{T},-@var{X}) @item expand_term(@var{T},-@var{X})
@item user:expand_term(@var{T},-@var{X})
@findex expand_term/2 @findex expand_term/2
@syindex expand_term/2 @syindex expand_term/2
@cyindex expand_term/2 @cyindex expand_term/2
@findex term_expansion/2
@syindex term_expansion/2
@cyindex term_expansion/2
This predicate is used by YAP for preprocessing each top level This predicate is used by YAP for preprocessing each top level
term read when consulting a file and before asserting or executing it. term read when consulting a file and before asserting or executing it.
It rewrites a term @var{T} to a term @var{X} according to the following It rewrites a term @var{T} to a term @var{X} according to the following
@ -6703,6 +6700,29 @@ rules: first try @code{term_expansion/2} in the current module, and then try to
for DCG rules is applied, together with the arithmetic optimizer for DCG rules is applied, together with the arithmetic optimizer
whenever the compilation of arithmetic expressions is in progress. whenever the compilation of arithmetic expressions is in progress.
@item @var{CurrentModule}:term_expansion(@var{T},-@var{X})
@item user:term_expansion(@var{T},-@var{X})
@findex term_expansion/2
@syindex term_expansion/2
@cyindex term_expansion/2
This user-defined predicate is called by @code{expand_term/3} to
preprocess all terms read when consulting a file. If it succeeds:
@itemize
@item
If @var{X} is of the form @code{:- G} or @code{?- G}, it is processed as
a directive.
@item
If @var{X} is of the form @code{'$source_location'(<File>,
<Line>):<Clause>} it is processed as if from @code{File} and line
@code{Line}.
@item
If @var{X} is a list, all terms of the list are asserted or processed
as directives.
@item The term @var{X} is asserted instead of @var{T}.
@end itemize
@item @var{CurrentModule}:goal_expansion(+@var{G},+@var{M},-@var{NG}) @item @var{CurrentModule}:goal_expansion(+@var{G},+@var{M},-@var{NG})
@item user:goal_expansion(+@var{G},+@var{M},-@var{NG}) @item user:goal_expansion(+@var{G},+@var{M},-@var{NG})
@findex goal_expansion/3 @findex goal_expansion/3
@ -9228,7 +9248,6 @@ also @code{between/3}.
Succeeds if @var{Set3} unifies with the intersection of @var{Set1} and Succeeds if @var{Set3} unifies with the intersection of @var{Set1} and
@var{Set2}. @var{Set1} and @var{Set2} are lists without duplicates. They @var{Set2}. @var{Set1} and @var{Set2} are lists without duplicates. They
need not be ordered. need not be ordered.
@end table
@item subtract(+@var{Set}, +@var{Delete}, ?@var{Result}) @item subtract(+@var{Set}, +@var{Delete}, ?@var{Result})
@findex subtract/3 @findex subtract/3