parameter(Number, Term)
Normally used only in parametric objects, this method returns parameter values by using the parameter position in the object identifier. Note that this predicate implies an unification between its second argument and the corresponding implicit context argument in the predicate containing the call. This unification occurs at the clause head, not at the clause body. See also this/1
.
parameter(+integer, ?term)
instantiation_error
type_error(integer, Number)
type_error(compound, Object)
domain_error(not_less_than_zero, Number)
:- object(box(_color, _weight)). ... color(Color) :- % this clause is translated into a fact parameter(1, Color). % upon compilation heavy :- parameter(2, Weight), % after compilation, the >/2 call will be Weight > 10. % the first condition on the clause body ...