extend nb_setarag/3 to call a default case at initialization, ie,

nb_getval(a, X, X=start).
and just that.
This commit is contained in:
Vítor Santos Costa 2014-10-02 14:35:38 +01:00
parent 2960f81e04
commit b8f1ee4a75

View File

@ -1370,7 +1370,15 @@ p_nb_getval( USES_REGS1 )
}
ge = FindGlobalEntry(AtomOfTerm(t) PASS_REGS);
if (!ge) {
return Yap_unify(TermNil, ARG3);
Term t3 = Deref(ARG3);
if (IsVarTerm(t3))
return FALSE;
if (IsApplTerm(t3)) {
if (FunctorOfTerm(t3) == FunctorEq)
return Yap_unify( ArgOfTerm(1, t3) , ArgOfTerm(2, t3) );
return FALSE;
}
return Yap_unify(t3, MkAtomTerm(AtomTrue));
}
READ_LOCK(ge->GRWLock);
to = ge->global;