TEST = new_env('TEST', int)
BOGUS = new_env('BOGUS', int)

@annot('void -> void')
def read():
    assert have_env(TEST), "Inside env"
    assert not have_env(BOGUS), "Outside env"
    assert env(TEST) == 1, "Env"

@annot('void -> int')
def read2():
    assert have_env(TEST), "Inside env"
    assert env(TEST) == 2, "Env"
    return 0

@annot('void -> int')
def main():
    in_env(TEST, 1, read)
    return in_env(TEST, 2, read2)

@@ -52,16 +52,211 @@
 , int)%0A%0A
+@annot('void -%3E int')%0Adef square_env():%0A    return env(TEST) * env(TEST)%0A%0A@annot('int -%3E int')%0Adef again(nine):%0A    assert env(TEST) == 1, %22Env inside%22%0A    return in_env(TEST, nine, square_env)%0A%0A
 @annot('
@@ -400,16 +400,67 @@
 1, %22Env%22
+%0A    assert again(9) == 81, %22Env param/ret passing%22
 %0A%0A@annot
@@ -515,32 +515,39 @@
 (TEST), %22Inside 
+second 
 env%22%0A    assert 
@@ -563,17 +563,24 @@
  == 2, %22
-E
+Second e
 nv%22%0A    

Improve env test