Change to simpler Eval mechanism

- avoid duplicate code
- implement different optimised code.
This commit is contained in:
Vítor Santos Costa
2008-12-04 23:33:32 +00:00
parent 13dd600f88
commit e737599dc4
14 changed files with 2563 additions and 5521 deletions

View File

@@ -49,9 +49,9 @@ p_setarg(void)
if (IsIntTerm(ti))
i = IntOfTerm(ti);
else {
union arith_ret v;
if (Yap_Eval(ti, &v) == long_int_e) {
i = v.Int;
Term te = Yap_Eval(ti);
if (IsIntegerTerm(te)) {
i = IntegerOfTerm(te);
} else {
Yap_Error(TYPE_ERROR_INTEGER,ti,"setarg/3");
return FALSE;