The solution is relatively simple : because these tail - recursive functions are really just easier ways of writing loops , have the compiler automatically transform them to loops 解決方案比較簡(jiǎn)單:因?yàn)槲策f歸函數(shù)實(shí)際上只是編寫循環(huán)的一種更簡(jiǎn)單的方式,所以就讓編譯器把它們自動(dòng)轉(zhuǎn)換成循環(huán)形式。
Because of this attribute , there is a nice correspondence between tail - recursive functions and loops : each recursive call can be thought of simply as one more iteration through a loop 由于這一特點(diǎn),在尾遞歸函數(shù)和循環(huán)之間有一個(gè)很好的對(duì)應(yīng)關(guān)系:可以簡(jiǎn)單地把每個(gè)遞歸調(diào)用看作是一個(gè)循環(huán)的多次迭代。