Insitu wrote:
Iulian Dragos <iulian.dragos@xxxxxxx> writes:
We don't do that. There are some solutions, for instance see "Tail call
elimination on the Java Virtual Machine" by Michel Schinz and Martin Odersky
http://citeseer.ist.psu.edu/schinz01tail.html
Really interesting, thx a lot. So basically, scala uses some sort of
trampolining for tail calls optimisation. Is this roughly correct ?
No, I am afraid I was unclear. Scalac doesn't eliminate general tail
calls, it only treats the simple case: recursive tail calls. I thought
the paper was interesting in itself, although scalac does not implement
the techniques described.
Iulian