Commits

Carl Friedrich Bolz committed 5be2f4c

this apparently seems to fix the test, unfortunately I didn't find the deeper
problem.

Comments (0)

Files changed (2)

prolog/interpreter/term.py

         else:
             assert isinstance(next, NonVar)
             if next is not other:
-                print "self", self, "next", next, "other", other
-                self.setvalue(other, heap)
-                print "self", self, "next", next, "other", other
-                import pdb; pdb.set_trace()
+                if isinstance(other, NonVar):
+                    self.setvalue(other, heap)
                 next._unify_derefed(other, heap, occurs_check)
-                print "self", self, "next", next, "other", other
 
     @specialize.arg(3)
     def _unify_derefed(self, other, heap, occurs_check=False):

prolog/interpreter/test/test_builtin.py

 
 def test_listify():
     e = get_engine("""
-        listify(_X, _X) :- 
+        listify(_X, _X) :-
             (var(_X); atomic(_X)), !.
         listify(_Expr, [_Op|_LArgs]) :-
             functor(_Expr, _Op, N),
             I1 is I+1,
             listify_list(I1, N, _Expr, _LArgs).
     """)
+    assert_true("listify(f(X), Y), Y = [f, X].", e)
+    assert_true("listify(f(X, g(1)), Y).", e)
     assert_true("listify(f(X, 1, g(1)), Y), Y = [f, X, 1, [g, 1]].", e)