Skip to content

Commit

Permalink
bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hhorikawa committed Sep 22, 2024
1 parent ea5b8c7 commit ee78567
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions evaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct Trampoline {
// 値 = AST なので、共用. `MORE` の場合 AST の意味。
value_t const value;

// ここが TCO になる
// MORE: 次の関数の環境. ここが TCO になる
EnvPtr const innerEnv;

Trampoline(const value_t& val): type(DONE), value(val) { }
Expand Down Expand Up @@ -76,7 +76,7 @@ value_t function::apply(ListPtr evaled_args)
// eval1_tco() 内では, 以下の部分は外出しにする
Trampoline t = eval_implicit_progn(m_body, inner);
if (t.type == Trampoline::MORE)
return EVAL1(t.value, inner);
return EVAL1(t.value, t.innerEnv);
else
return t.value;
}
Expand Down

0 comments on commit ee78567

Please sign in to comment.