try to speed up eval a bit.
This commit is contained in:
parent
a792174a0e
commit
a7e6c5672e
4
C/eval.c
4
C/eval.c
|
@ -120,9 +120,9 @@ Eval(Term t)
|
||||||
}
|
}
|
||||||
|
|
||||||
Term
|
Term
|
||||||
Yap_Eval(Term t)
|
Yap_InnerEval(Term t)
|
||||||
{
|
{
|
||||||
return Yap_FoundArithError(Eval(t), t);
|
return Eval(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef BEAM
|
#ifdef BEAM
|
||||||
|
|
14
H/eval.h
14
H/eval.h
|
@ -169,16 +169,24 @@ Term STD_PROTO(Yap_eval_atom,(Int));
|
||||||
Term STD_PROTO(Yap_eval_unary,(Int,Term));
|
Term STD_PROTO(Yap_eval_unary,(Int,Term));
|
||||||
Term STD_PROTO(Yap_eval_binary,(Int,Term,Term));
|
Term STD_PROTO(Yap_eval_binary,(Int,Term,Term));
|
||||||
|
|
||||||
Term STD_PROTO(Yap_Eval,(Term));
|
Term STD_PROTO(Yap_InnerEval,(Term));
|
||||||
Int STD_PROTO(Yap_ArithError,(yap_error_number,Term,char *msg, ...));
|
Int STD_PROTO(Yap_ArithError,(yap_error_number,Term,char *msg, ...));
|
||||||
|
|
||||||
|
inline EXTERN Term
|
||||||
|
Yap_Eval(Term t)
|
||||||
|
{
|
||||||
|
if (t == 0L || !IsVarTerm(t) || IsNumTerm(t))
|
||||||
|
return t;
|
||||||
|
return Yap_InnerEval(t);
|
||||||
|
}
|
||||||
|
|
||||||
inline static Term
|
inline static Term
|
||||||
Yap_FoundArithError(Term t, Term inp)
|
Yap_FoundArithError(Term t, Term inp)
|
||||||
{
|
{
|
||||||
if (Yap_Error_TYPE) {
|
if (Yap_Error_TYPE) {
|
||||||
Yap_Error(Yap_Error_TYPE, (inp ? inp : Yap_Error_Term), Yap_ErrorMessage);
|
Yap_Error(Yap_Error_TYPE, (inp ? inp : Yap_Error_Term), Yap_ErrorMessage);
|
||||||
P = FAILCODE;
|
P = FAILCODE;
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue