def test_letrec_fac(self): from util import m, n, fac eq_( eval( letrec([ (fac, lamda([n], if_(eq(n, 1), 1, mul(n, fac(sub(n, 1)))))) ], fac(3))), 6)
def test_letrec_fac(self): from util import m, n fac = MacroVar('fac') eq_( eval( letrec([ (fac, macro([n], if_(eq(n, 1), 1, mul(n, fac(sub(n, 1)))))) ], fac(3))), 6)
def test_letrec_fac(self): from util import m, n fac = MacroVar('fac') eq_(eval(letrec([(fac, macro([n], if_(eq(n,1), 1, mul(n, fac(sub(n, 1))))))], fac(3))), 6)
def test_letrec_fac(self): from util import m, n, fac eq_(eval(letrec([(fac, lamda([n], if_(eq(n,1), 1, mul(n, fac(sub(n, 1))))))], fac(3))), 6)