goal_expansion(Goal, ExpandedGoal)
Defines an expansion for a goal. The first argument is the goal to be expanded. The expanded goal is returned in the second argument. This predicate is called recursively on the expanded goal until there are no changes. Thus, care must be taken to avoid compilation loops. This predicate, when defined, is automatically called by the expand_goal/2
method. Use of this predicate by the expand_goal/2
method may be restricted by using a scope directive for it. This predicate is called when compiling source files.
Goal expansion may be used either by calling the expand_goal/2
method explicitly or by using hook objects. Clauses for the goal_expansion/2
predicate defined within an object or a category are never used in the compilation of the object or the category itself.
Any expanded goal wrapped in the {}/1
compiler bypass control construct will not be further compiled but used as-is.
goal_expansion(+callable, -callable)
(none)