Example #1
0
 def test_eval_Case1(self):
     x = preparse(v.x)
     eq_(
         eval(
             case(2).of(1)[prin(1)].of(2, 3)[prin(quote((2, 3))),
                                             quote((2, 3))].els[prin(5)]),
         (2, 3))
Example #2
0
 def test_eval_Case3(self):
     x = preparse(v.x)
     eq_(
         eval(
             begin(
                 v.x << quote((1, 2)),
                 case(x).of((1, 2), (3, 4))[prin(x), x].of(2, 3)[prin(
                     (2, 3)), (2, 3)].els[prin(5)])), (1, 2))
Example #3
0
 def testeval2(self):
   eq_(eval(let([(x,1)], eval_(quote(x)))), 1)
Example #4
0
 def testeval1(self):
   eq_(eval(eval_(quote(1))), (1))
   eq_(eval(eval_(quote(add(1, 1)))), (2))
Example #5
0
 def testquote(self):
   eq_(eval(quote(x)), x)
Example #6
0
 def test_eval_getitem2(self):
     eq_(
         eval(
             each(v.i, v.j)[range(2)][range(2)].loop[prin(v.i, v.j),
                                                     quote((v.i, v.j))]),
         None)
Example #7
0
 def test_eval_getitem1(self):
     eq_(
         eval(
             each(v.i, v.j)[zip(range(2),
                                range(2))].loop[prin(v.i, v.j),
                                                quote((v.i, v.j))]), None)
Example #8
0
 def test_eval_slice(self):
     eq_(
         eval(
             each(v.i, v.j)[1:3][1:3].loop[prin(v.i, v.j),
                                           quote((v.i, v.j))]), None)
Example #9
0
 def test_eval_getitem2(self):
   eq_(eval(each(v.i,v.j)[range(2)][range(2)].loop[prin(v.i, v.j), quote((v.i, v.j))]), 
       None) 
Example #10
0
 def test_eval_getitem1(self):
   eq_(eval(each(v.i,v.j)[zip(range(2), range(2))].loop[prin(v.i, v.j), quote((v.i, v.j))]), 
       None) 
Example #11
0
 def test_eval_slice(self):
   eq_(eval(each(v.i,v.j)[1:3][1:3].loop[prin(v.i, v.j), quote((v.i, v.j))]), 
       None) 
Example #12
0
 def test_eval_Case3(self):
   x = preparse(v.x)
   eq_(eval(begin(v.x<<quote((1,2)), case(x).of((1,2), (3,4))[prin(x), x].of(2,3)[prin((2,3)), (2,3)].els[prin(5)])), 
       (1,2)) 
Example #13
0
 def test_eval_Case1(self):
   x = preparse(v.x)
   eq_(eval(case(2).of(1)[prin(1)].of(2,3)[prin(quote((2,3))), quote((2,3))].els[prin(5)]), 
       (2,3)) 
Example #14
0
 def testquote(self):
     eq_(preparse(quote(x)), quote(x))