def map_reify(state, container): acc = (state.gen_sym, immutabledict()) acc, new_container = map_accum(_reify_func, acc, container) gen_sym, bindings = acc new_state = state.update(gen_sym=gen_sym, temp_bindings=state.temp_bindings.update(bindings)) return new_state, new_container
def map_get_value(container): _, new_container = map_accum(lambda acc, kvalue: (acc, kvalue.value), None, container) return new_container
def map_peval_expression(state, container, ctx): return map_accum(_peval_expression, state, container, ctx)