fixes to SWI interface
This commit is contained in:
parent
d648375412
commit
327c1216e4
@ -539,6 +539,7 @@ extern X_API int PL_is_functor(term_t, functor_t);
|
||||
extern X_API int PL_is_ground(term_t);
|
||||
extern X_API int PL_is_callable(term_t);
|
||||
extern X_API int PL_is_integer(term_t);
|
||||
extern X_API int PL_is_pair(term_t);
|
||||
extern X_API int PL_is_list(term_t);
|
||||
extern X_API int PL_is_number(term_t);
|
||||
extern X_API int PL_is_string(term_t);
|
||||
|
@ -1627,9 +1627,11 @@ X_API int PL_term_type(term_t t)
|
||||
return PL_VARIABLE;
|
||||
} else if (IsAtomTerm(v)) {
|
||||
return PL_ATOM;
|
||||
} else if (YAP_IsIntTerm(v)) {
|
||||
} else if (IsStringTerm(v)) {
|
||||
return PL_STRING;
|
||||
} else if (IsIntegerTerm(v)) {
|
||||
return PL_INTEGER;
|
||||
} else if (YAP_IsFloatTerm(v)) {
|
||||
} else if (IsFloatTerm(v)) {
|
||||
return PL_FLOAT;
|
||||
} else {
|
||||
return PL_TERM;
|
||||
@ -1671,14 +1673,14 @@ X_API int PL_is_atomic(term_t ts)
|
||||
{
|
||||
CACHE_REGS
|
||||
YAP_Term t = Yap_GetFromSlot(ts PASS_REGS);
|
||||
return !YAP_IsVarTerm(t) || !YAP_IsApplTerm(t) || !YAP_IsPairTerm(t);
|
||||
return !IsVarTerm(t) || !IsApplTerm(t) || !IsPairTerm(t);
|
||||
}
|
||||
|
||||
X_API int PL_is_compound(term_t ts)
|
||||
{
|
||||
CACHE_REGS
|
||||
YAP_Term t = Yap_GetFromSlot(ts PASS_REGS);
|
||||
return (YAP_IsApplTerm(t) || YAP_IsPairTerm(t));
|
||||
return (IsApplTerm(t) || IsPairTerm(t));
|
||||
}
|
||||
|
||||
X_API int PL_is_functor(term_t ts, functor_t f)
|
||||
@ -1698,7 +1700,7 @@ X_API int PL_is_float(term_t ts)
|
||||
{
|
||||
CACHE_REGS
|
||||
YAP_Term t = Yap_GetFromSlot(ts PASS_REGS);
|
||||
return YAP_IsFloatTerm(t);
|
||||
return !IsVarTerm(t) && IsFloatTerm(t);
|
||||
}
|
||||
|
||||
X_API int PL_is_integer(term_t ts)
|
||||
@ -1726,6 +1728,13 @@ X_API int PL_is_list(term_t ts)
|
||||
return !IsVarTerm(t) && (t == TermNil || IsPairTerm(t));
|
||||
}
|
||||
|
||||
X_API int PL_is_pair(term_t ts)
|
||||
{
|
||||
CACHE_REGS
|
||||
YAP_Term t = Yap_GetFromSlot(ts PASS_REGS);
|
||||
return !IsVarTerm(t) && IsPairTerm(t);
|
||||
}
|
||||
|
||||
X_API int
|
||||
PL_skip_list(term_t list, term_t tail, size_t *len)
|
||||
{
|
||||
@ -1758,7 +1767,7 @@ X_API int PL_is_number(term_t ts)
|
||||
{
|
||||
CACHE_REGS
|
||||
YAP_Term t = Yap_GetFromSlot(ts PASS_REGS);
|
||||
return YAP_IsIntTerm(t) || YAP_IsBigNumTerm(t) || YAP_IsFloatTerm(t);
|
||||
return IsIntegerTerm(t) || IsBigIntTerm(t) || IsFloatTerm(t);
|
||||
}
|
||||
|
||||
X_API int PL_is_string(term_t ts)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 626133d5b507de73398f2285be7fe8f3d817a16c
|
||||
Subproject commit 9c65bc41956b387fb41a7a91f67c65611c5c9466
|
Reference in New Issue
Block a user