示例#1
0
 def test_quote2(self):
     x = LogicVar('x')
     eq_(eval(quote(x)), LogicVar('x'))
示例#2
0
 def test_quote(self):
   result = compile(quote(1))
   expect = "ExpressionWithCode((1), (lambda : 1))"
   eq_(result, expect)
示例#3
0
 def test_quote(self):
     lo_x = LogicVar('x')
     eq_(eval(quote(lo_x)), LogicVar('x'))
示例#4
0
 def test_quote(self):
   result = cps(quote(1))
   expect = done()(1)
   eq_(result, expect)
示例#5
0
 def testcall(self):
   eq_(eval(call(unify(x, 1))), True)
   eq_(eval(is_(x, quote(prin(1)))&call(x)), None)
示例#6
0
 def testeval3(self):
     x = Const('x')
     eq_(eval(let([(x, quote(1))], eval_(x))), 1)
示例#7
0
 def testeval0(self):
     eq_(eval(eval_(quote(1))), (1))
示例#8
0
文件: testeval.py 项目: chaosim/dao
 def test_quote2(self):
   x = LogicVar('x')
   eq_(eval(quote(x)), LogicVar('x'))
示例#9
0
文件: testeval.py 项目: chaosim/dao
 def testeval5(self):
   eq_(eval(eval_(quote(begin(1, 2)))), 2)
   eq_(eval(eval_(quote(begin(1, add(1, 2))))), 3)
示例#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)
示例#11
0
文件: testeval.py 项目: chaosim/dao
 def test_quote(self):
   lo_x = LogicVar('x')
   eq_(eval(quote(lo_x)), LogicVar('x'))
示例#12
0
 def test_unquote_slice(self):
     eq_(eval(qq(add(uqs(quote((3, 4)))))), add(3, 4))
示例#13
0
 def testcall(self):
     eq_(eval(call(unify(x, 1))), True)
     eq_(eval(is_(x, quote(prin(1))) & call(x)), None)
示例#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)
示例#15
0
 def testeval5(self):
     eq_(eval(eval_(quote(begin(1, 2)))), 2)
     eq_(eval(eval_(quote(begin(1, add(1, 2))))), 3)
示例#16
0
文件: testeval.py 项目: chaosim/dao
 def testeval2(self):
   x = Const('x')
   eq_(eval(let([(x,1)], eval_(quote(x)))), 1)
示例#17
0
 def testeval2(self):
     x = Const('x')
     eq_(eval(let([(x, 1)], eval_(quote(x)))), 1)
示例#18
0
文件: testeval.py 项目: chaosim/dao
 def testeval3(self):
   x = Const('x')
   eq_(eval(let([(x, quote(1))], eval_(x))), 1)
示例#19
0
 def testeval4(self):
     x = Const('x')
     eq_(eval(let([(x, quote(add(1, 1)))], eval_(x))), 2)
示例#20
0
文件: testeval.py 项目: chaosim/dao
 def testeval4(self):
   x = Const('x')
   eq_(eval(let([(x, quote(add(1,1)))], eval_(x))), 2)
示例#21
0
 def testeval1(self):
     eq_(eval(eval_(quote(add(1, 1)))), (2))
示例#22
0
文件: testeval.py 项目: chaosim/dao
 def testeval0(self):
   eq_(eval(eval_(quote(1))), (1))
示例#23
0
 def test_quote(self):
     result = cps(quote(1))
     expect = done()(1)
     eq_(result, expect)
示例#24
0
文件: testeval.py 项目: chaosim/dao
 def testeval1(self):
   eq_(eval(eval_(quote(add(1, 1)))), (2))
示例#25
0
 def test_unquote_slice(self):
   eq_(eval(qq(add(uqs(quote((3,4)))))), add(3, 4))
示例#26
0
 def test_quote(self):
     result = compile(quote(1))
     expect = "ExpressionWithCode((1), (lambda : 1))"
     eq_(result, expect)