2,619
次編輯
Tankianting(討論 | 貢獻) |
Tankianting(討論 | 貢獻) |
||
行 79: | 行 79: | ||
===閉包=== | ===閉包=== | ||
<pre> | |||
(x)=>{foo(x, free_vars)} | (x)=>{foo(x, free_vars)} | ||
</pre> | |||
轉換 | 轉換 | ||
<pre> | |||
ThunkAnony8964 thunkanony8964(TypeOfX x ,TypeFreeVars env){ | ThunkAnony8964 thunkanony8964(TypeOfX x ,TypeFreeVars env){ | ||
foo(x, env[free_vars]); | foo(x, env[free_vars]); | ||
行 102: | 行 101: | ||
anony8964.thunk = *thunkanony8964; | anony8964.thunk = *thunkanony8964; | ||
</pre> | |||
執行函數 | |||
<pre> | |||
lambda(x){body}(n); | lambda(x){body}(n); | ||
</pre> | |||
改為 | 改為 | ||
<pre> | |||
anony9864.thunk(n, anony8964.env); | anony9864.thunk(n, anony8964.env); | ||
</pre> | |||
== 如何代碼刪除不須存在的變數或函數? == | == 如何代碼刪除不須存在的變數或函數? == |