
Roberto Bagnara writes:
Bart Demoen wrote:
should be easy to fix: seems like is_var does not deref
I have checked: none of the is_*() functions seems to dereference. However, other interface functions do dereference.
Notice also that, while cinterf.h contains the declaration of p2p_deref() along with the rather obscure comment
** p2p_deref: prolog_term -> prolog_term !! uncommon
p2p_deref() is never mentioned in the XSB manuals.
So the questions are: how is one supposed to use the foreign language interface? Calling p2p_deref() before any invocation of is_*()? Are there other interface functions that require the client code to call p2p_deref() for proper operation?
This certainly looks to me like a bug. I think we should put deref's into all those interface functions. I can only imagine that Jiyang, when he wrote these routines, expected to use the p2p_deref, but somehow that "convention" got lost down through the ages (in the later documentation in particular). Does anyone have any reason we shouldn't add the derefs?
-David