[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tail Recursion

 >From: Jeffrey Mark Siskind <Qobi@zermatt.lcs.mit.edu> 
 >Jonathan Rees has a Scheme compiler for the 3600. I have never used it 
 >so I can't comment on its quality. Actually I would very much like 
 >the plain 3600 Common Lisp compiler to support tail recursion (and 
 >continuations as well --- though the latter would require some 
 >extensions to the language.) Many times I have taken to writing loops 
 >instead of tail recursive calls solely for performance reasons and 
 >would like to be able to stop that practise. 
 >        Jeff

I thought the CL compiler DID support tail recursion properly?
At least, when I disassemble tail-recursive code I see a CALL-1-RETURN
which I have been (improperly?) assuming corresponded to a branch
instruction, nicht wahr?  I know it says CALL in there, but it's
different from the internal function calls.  Since the compiler knows
it is to return the value of the call, i.e. it has recognized the
tail-recursive situation, is call-1-return still doing all the
unnecessary function call overhead anyway?  If so, why???????????

-Kurt Godden