From: Rob M. <ra...@ri...> - 2005-10-28 13:14:12
|
> > Unless I'm grossly misunderstanding something, there's no inlining > going on in your example regardless of which definition of FOO is > used. The difference between the two cases is that one gets tail-call > optimized, the other doesn't. > > Surprisingly the one that doesn't get optimized is the one where the > compiler has access to more information. For some reason > FLUSH-FULL-CALL-TAIL-TRANSFER explicitly forbids tail-calls to > functions when the return convention isn't :UNKNOWN. > This is because in designing the tail-call support in Python I was drawing on the Scheme implementation tradition where tail recursion is not considered an optional optimization. All calls that can be tail recursive must be tail recursive. If a function that is returning with the unknown convention calls a function with known returns then it must suppress tail recursion so that the can receive the values and massage them into the unknown convention. As I recall, SBCL has taken the position that since ANSI says nothing about tail recursion then it is unimportant. Rob |