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

meta_bind(-Meta, ?Term)

The metaterm Meta is bound to the term Term without triggering the metaterm-unification event.
-Meta
A metaterm.
?Term
Prolog term.

Description

The metaterm Meta is treated like a standard variable and bound to Term. The difference compared to using normal unification is that meta_bind/2 does not raise the meta-unification event, as is normally the case whenever a metaterm is bound. An example of its use is in the handler for the meta-unification event itself, e.g. when the metaterm is to be bound to a new one with a different attribute.

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) instantiation fault
Meta is a free variable.
(5) type error
Meta is instantiated.

Examples

    [eclipse 2]: meta_bind(X{a}, 3).

    X = 3
    yes.

    [eclipse 5]: [user].
     change_attribute(X{_Old}, New) ?- meta_bind(X, _{New}).

    yes.
    [eclipse 6]: change_attribute(X{a}, b), printf("%Mw", [X]).
    X{b}

Error:
    meta_bind(_, a).                    (Error 4).
    meta_bind(a, a).                    (Error 5).



See Also

meta / 1