-
tetsu_koba
- 7284
- 0
- 3
- 0
![](https://s.togetter.com/static/web/img/placeholder.gif)
Scheme はその言語定義で、tail リカーシブを実装することが必要だ。#kernelvm
2013-10-19 13:52:32![](https://s.togetter.com/static/web/img/placeholder.gif)
tail recursive interpreterで検索したらbrainfuckで動くtail recursive interpreterとかでてきた https://t.co/8xmBcnJRco #kernelvm
2013-10-19 13:53:05![](https://s.togetter.com/static/web/img/placeholder.gif)
素朴なinterpreterだとevalがなんども再帰的に呼ばれてstackがいっぱいになる #kernelvm
2013-10-19 13:53:59![](https://s.togetter.com/static/web/img/placeholder.gif)
関数呼び出しに出会ったら、先読みをしてそのあとに仕事があるかどうかでstackに積むか積まないかと考える #kernelvm
2013-10-19 13:54:58![](https://s.togetter.com/static/web/img/placeholder.gif)
tail recurciveなeval()は函数呼び出しに出会った時に、一つ次を先読みしてもし次にも仕事があればスタックに積む #kernelvm
2013-10-19 13:55:53![](https://s.togetter.com/static/web/img/placeholder.gif)
#Erlang の場合,古典的なCのforループっぽいものを実現するとなると,各ループごとにtail recursiveな関数作ってまとめちゃうという方法があります,というか,他に実現方法がない #kernelvm
2013-10-19 13:59:51