Well, now func: isn't always tail recursive--it depends on whether "self" is a Foo or a Bar!
I posted a message on the subject to c.l.s a while ago, it is available here:
http://www.dejanews.com/getdoc.xp?AN=175406946
Executive summary: 1) "tail recursion" is a misnomer, "tail call" is a more exact name(your example, Lex, is still tail-callable); 2) it is possible in Smalltalk; 3) none of the existing Smalltalks do it.
--Vassili
Vassili Bykov wrote:
Executive summary: 1) "tail recursion" is a misnomer, "tail call" is a more exact name(your example, Lex, is still tail-callable); 2) it is possible in Smalltalk; 3) none of the existing Smalltalks do it.
IIRC Smalltalk MT ( http://www.objectconnect.com/ ) can be told to compile code as tail callable -- but this is to native code.
-- Dwight
squeak-dev@lists.squeakfoundation.org