YAP 7.1.0
nb_linkval/2

nb_linkval(+ Name, + Value) More...

Detailed Description

nb_linkval(+ Name, + Value)

Associates the term Value with the atom Name without copying it This is a fast special-purpose variation of nb_setval/2 intended for expert users only because the semantics on backtracking to a point before creating the link are poorly defined for compound terms The principal term is always left untouched, but backtracking behaviour on arguments is undone if the original assignment was trailed and left alone otherwise, which implies that the history that created the term affects the behaviour on backtracking Please consider the following example:

demo_nb_linkval :-
T = nice(N),
( N = world,
nb_linkval(myvar, T),
fail
; nb_getval(myvar, V),
writeln(V)
).
If you like being short, use T instead of YapTerm.
Definition: yapt.hh:266

The documentation for this class was generated from the following file: