Beispiel #1
0
 def test_quote2(self):
     x = LogicVar('x')
     eq_(eval(quote(x)), LogicVar('x'))
Beispiel #2
0
 def test_quote(self):
   result = compile(quote(1))
   expect = "ExpressionWithCode((1), (lambda : 1))"
   eq_(result, expect)
Beispiel #3
0
 def test_quote(self):
     lo_x = LogicVar('x')
     eq_(eval(quote(lo_x)), LogicVar('x'))
Beispiel #4
0
 def test_quote(self):
   result = cps(quote(1))
   expect = done()(1)
   eq_(result, expect)
Beispiel #5
0
 def testcall(self):
   eq_(eval(call(unify(x, 1))), True)
   eq_(eval(is_(x, quote(prin(1)))&call(x)), None)
Beispiel #6
0
 def testeval3(self):
     x = Const('x')
     eq_(eval(let([(x, quote(1))], eval_(x))), 1)
Beispiel #7
0
 def testeval0(self):
     eq_(eval(eval_(quote(1))), (1))
Beispiel #8
0
 def test_quote2(self):
   x = LogicVar('x')
   eq_(eval(quote(x)), LogicVar('x'))
Beispiel #9
0
 def testeval5(self):
   eq_(eval(eval_(quote(begin(1, 2)))), 2)
   eq_(eval(eval_(quote(begin(1, add(1, 2))))), 3)
Beispiel #10
0
 def test_quote(self):
     result = compile_optimize(quote(1))
     expect = il.ExpressionWithCode(il.Integer(1),
                                    il.Lamda((), il.Integer(1)))
     eq_(result, expect)
Beispiel #11
0
 def test_quote(self):
   lo_x = LogicVar('x')
   eq_(eval(quote(lo_x)), LogicVar('x'))
Beispiel #12
0
 def test_unquote_slice(self):
     eq_(eval(qq(add(uqs(quote((3, 4)))))), add(3, 4))
Beispiel #13
0
 def testcall(self):
     eq_(eval(call(unify(x, 1))), True)
     eq_(eval(is_(x, quote(prin(1))) & call(x)), None)
Beispiel #14
0
 def test_quote(self):
   result = compile_optimize(quote(1))
   expect = il.ExpressionWithCode(il.Integer(1), il.Lamda((), il.Integer(1)))
   eq_(result, expect)
Beispiel #15
0
 def testeval5(self):
     eq_(eval(eval_(quote(begin(1, 2)))), 2)
     eq_(eval(eval_(quote(begin(1, add(1, 2))))), 3)
Beispiel #16
0
 def testeval2(self):
   x = Const('x')
   eq_(eval(let([(x,1)], eval_(quote(x)))), 1)
Beispiel #17
0
 def testeval2(self):
     x = Const('x')
     eq_(eval(let([(x, 1)], eval_(quote(x)))), 1)
Beispiel #18
0
 def testeval3(self):
   x = Const('x')
   eq_(eval(let([(x, quote(1))], eval_(x))), 1)
Beispiel #19
0
 def testeval4(self):
     x = Const('x')
     eq_(eval(let([(x, quote(add(1, 1)))], eval_(x))), 2)
Beispiel #20
0
 def testeval4(self):
   x = Const('x')
   eq_(eval(let([(x, quote(add(1,1)))], eval_(x))), 2)
Beispiel #21
0
 def testeval1(self):
     eq_(eval(eval_(quote(add(1, 1)))), (2))
Beispiel #22
0
 def testeval0(self):
   eq_(eval(eval_(quote(1))), (1))
Beispiel #23
0
 def test_quote(self):
     result = cps(quote(1))
     expect = done()(1)
     eq_(result, expect)
Beispiel #24
0
 def testeval1(self):
   eq_(eval(eval_(quote(add(1, 1)))), (2))
Beispiel #25
0
 def test_unquote_slice(self):
   eq_(eval(qq(add(uqs(quote((3,4)))))), add(3, 4))
Beispiel #26
0
 def test_quote(self):
     result = compile(quote(1))
     expect = "ExpressionWithCode((1), (lambda : 1))"
     eq_(result, expect)