コード例 #1
0
ファイル: views.py プロジェクト: paulfchristiano/interpreter
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)
コード例 #2
0
def let(var, val, f):
    return apply(quote(f), literal_term(T.from_dict({var:val})))
コード例 #3
0
ファイル: state.py プロジェクト: paulfchristiano/interpreter
def starting_state():
    return state(T.from_dict({}), handlers.view_handler())
コード例 #4
0
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))