This commit is contained in:
Vitor Santos Costa
2017-01-09 14:58:57 +00:00
parent 6778ea2975
commit 4db2a1fe7f
9 changed files with 53 additions and 47 deletions

View File

@@ -6,16 +6,7 @@
extern "C" {
Term YAP_ReadBuffer(const char *s, Term *tp);
#if defined(SWIGPYTHON) && 0
#include <Python.h>
extern Term pythonToYAP(PyObject *inp);
#define YAPTerm _YAPTERM
#elifndef HAVE_PYTHON_H
typdef struct { int no_python; } PyObject;
#else
#include <Python.h>
#endif
};
}
class YAPError;
@@ -55,14 +46,12 @@ public:
};
YAPTerm(Term tn) { mk(tn); };
YAPTerm(PyObject *inp) {
#ifdef SWIGPYTHON
YAPTerm(PyObject *inp) {
Term tinp = pythonToYAP(inp);
t = Yap_InitSlot(tinp);
#else
t = 0;
#endif
}
#endif
/// private method to convert from Term (internal YAP representation) to
/// YAPTerm
// do nothing constructor
@@ -96,7 +85,7 @@ public:
inline void bind(YAPTerm *b) { LOCAL_HandleBase[t] = b->term(); }
/// from YAPTerm to Term (internal YAP representation)
/// fetch a sub-term
Term &operator[](size_t n);
Term &operator[](arity_t n);
// const YAPTerm *vars();
/// this term is == to t1
virtual bool exactlyEqual(YAPTerm t1) {