fix nb_current/2
This commit is contained in:
parent
46f0a0644c
commit
51982bee42
12
C/globals.c
12
C/globals.c
@ -2613,10 +2613,16 @@ init_current_nb(void)
|
||||
{ /* current_atom(?Atom) */
|
||||
Term t1 = Deref(ARG1);
|
||||
if (!IsVarTerm(t1)) {
|
||||
if (IsAtomTerm(t1))
|
||||
cut_succeed();
|
||||
else
|
||||
if (IsAtomTerm(t1)) {
|
||||
if (!FindGlobalEntry(AtomOfTerm(t1))) {
|
||||
cut_fail();
|
||||
} else {
|
||||
cut_succeed();
|
||||
}
|
||||
} else {
|
||||
Yap_Error(TYPE_ERROR_ATOM,t1,"nb_current");
|
||||
cut_fail();
|
||||
}
|
||||
}
|
||||
READ_LOCK(HashChain[0].AERWLock);
|
||||
EXTRA_CBACK_ARG(1,1) = MkIntegerTerm((Int)GlobalVariables);
|
||||
|
@ -577,9 +577,6 @@ nth_instance(Key,Index,T,Ref) :-
|
||||
instance(Ref,T).
|
||||
|
||||
nb_current(GlobalVariable, Val) :-
|
||||
var(GlobalVariable), !,
|
||||
'$nb_current'(GlobalVariable),
|
||||
nb_getval(GlobalVariable, Val).
|
||||
nb_current(GlobalVariable, Val) :-
|
||||
nb_getval(GlobalVariable, Val).
|
||||
|
||||
|
Reference in New Issue
Block a user