Sunday, May 13, 2012
Lua의 tail call
Tail call 이란 함수 내에서 다른 함수를 call 할때 기존의 방식처럼 stack 에 쌓이는 게 아니라
goto 방식으로 이동하는 방식. 따라서 아무리 많이 recursive call 을 하더라도 stack overflow 가
생기지 않는다. Lua에서는 return func(args) 의 형태만이 tail call 이다.
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment