def shell(asker): current_view = view(T.from_list_of_str(["(Home)"]), T.from_dict({})) asker.tag(T("the current view"), current_view) while True: input = asker.ask_firmly(elicit(current_view)) asker.ask(update_view(current_view, input)) current_view = asker.refresh(current_view)
def let(var, val, f): return apply(quote(f), literal_term(T.from_dict({var:val})))
def starting_state(): return state(T.from_dict({}), handlers.view_handler())
def make_dict_expr(ms): d = {ms[i]:ms[i+1] for i in range(0, len(ms), 2)} return T(make_dict_expr.head, map=T.from_dict(d))