def make_expression(text): code = begin( sexpression_defines, classic_defines, set_text(text), from_(classic, program)(exp), eoi, eval_(pycall(cons2tuple, exp))) return to_sexpression(code)
def test_let_in_module(self): a, m1, m2 = Var('a'), Var('m1'), Var('m2') eq_(eval(let([(m1,module(define(a,1), let([(a,2)], define(a,3))))], from_(m1,a))), 1)
def testfrom(self): a, m = Var('a'), Var('m') eq_(eval(let([(m,module(define(a,1)))], from_(m,a))), 1)
def test_embeded_module(self): a, m1, m2 = Var('a'), Var('m1'), Var('m2') eq_(eval(let([(m1,module(define(a,1),define(m2, module(define(a,2)))))], from_(from_(m1,m2),a))), 2)
def from_sexp(var): return from_(sexpression_module, var)