def test_quote2(self): x = LogicVar('x') eq_(eval(quote(x)), LogicVar('x'))
def test_quote(self): result = compile(quote(1)) expect = "ExpressionWithCode((1), (lambda : 1))" eq_(result, expect)
def test_quote(self): lo_x = LogicVar('x') eq_(eval(quote(lo_x)), LogicVar('x'))
def test_quote(self): result = cps(quote(1)) expect = done()(1) eq_(result, expect)
def testcall(self): eq_(eval(call(unify(x, 1))), True) eq_(eval(is_(x, quote(prin(1)))&call(x)), None)
def testeval3(self): x = Const('x') eq_(eval(let([(x, quote(1))], eval_(x))), 1)
def testeval0(self): eq_(eval(eval_(quote(1))), (1))
def testeval5(self): eq_(eval(eval_(quote(begin(1, 2)))), 2) eq_(eval(eval_(quote(begin(1, add(1, 2))))), 3)
def test_quote(self): result = compile_optimize(quote(1)) expect = il.ExpressionWithCode(il.Integer(1), il.Lamda((), il.Integer(1))) eq_(result, expect)
def test_unquote_slice(self): eq_(eval(qq(add(uqs(quote((3, 4)))))), add(3, 4))
def testcall(self): eq_(eval(call(unify(x, 1))), True) eq_(eval(is_(x, quote(prin(1))) & call(x)), None)
def testeval2(self): x = Const('x') eq_(eval(let([(x,1)], eval_(quote(x)))), 1)
def testeval2(self): x = Const('x') eq_(eval(let([(x, 1)], eval_(quote(x)))), 1)
def testeval4(self): x = Const('x') eq_(eval(let([(x, quote(add(1, 1)))], eval_(x))), 2)
def testeval4(self): x = Const('x') eq_(eval(let([(x, quote(add(1,1)))], eval_(x))), 2)
def testeval1(self): eq_(eval(eval_(quote(add(1, 1)))), (2))
def test_unquote_slice(self): eq_(eval(qq(add(uqs(quote((3,4)))))), add(3, 4))