-- NOTE: New bindings generated by the body are forgotten after
--       the body is executed
forkClosureBody :: CodeGen a -> CodeGen (a, CgState)
forkClosureBody body =
  local (\env -> env { cgSequel = Return
                     , cgSelfLoop = Nothing })
       . newClosureGeneric $ do
    oldBindings <- getBindings
    result <- body
    setBindings oldBindings
    return result
forkClosureBody :: CodeGen a -> CodeGen (a, CgState)
forkClosureBody body =
  local (\env -> env { cgSequel = Return
                     , cgSelfLoop = Nothing })
       . newClosureGeneric $ do
    oldBindings <- getBindings
    result <- body
    setBindings oldBindings
    return result
forkClosureBody body =
  local (\env -> env { cgSequel = Return
                     , cgSelfLoop = Nothing })
       . newClosureGeneric $ do
    oldBindings <- getBindings
    result <- body
    setBindings oldBindings
    return result