def test_label(self):
     e = execute_lisp_program((
         (
             "label",
             "map_f_over_l",
             ("lambda", ("f", "l"), ("cond", (
                 (("null", "l"), ("quote", ())),
                 (
                     ("quote", "t"),
                     (
                         "cons",
                         ("f", ("car", "l")),
                         ("map_f_over_l", "f", ("cdr", "l")),
                     ),
                 ),
             ))),
         ),
         ("quote", "atom"),
         ("quote", ((), ("u", "v"), "w")),
     ))
     self.assertEqual(e, ("t", (), "t"))
示例#2
0
 def test_label(self):
     e = execute_lisp_program((
         (
             "label",
             "map_f_over_l",
             ("lambda", ("f", "l"), ("cond", (
                 (("null", "l"), ("quote", ())),
                 (
                     ("quote", "t"),
                     (
                         "cons",
                         ("f", ("car", "l")),
                         ("map_f_over_l", "f", ("cdr", "l")),
                     ),
                 ),
             ))),
         ),
         ("quote", "atom"),
         ("quote", ((), ("u", "v"), "w")),
     ))
     self.assertEqual(e, ("t", (), "t"))
 def test_a_program(self):
     e = execute_lisp_program(
         ("list", ("quote", "a"), ("quote", "b")),
     )
     self.assertEqual(e, ("a", "b"))
示例#4
0
 def test_a_program(self):
     e = execute_lisp_program(("list", ("quote", "a"), ("quote", "b")), )
     self.assertEqual(e, ("a", "b"))