Tail Call

Anthony Hannan ajh18 at cornell.edu
Fri Feb 1 07:37:30 UTC 2002


Scott A Crosby <crosby at qwes.math.cmu.edu> wrote:
> BTW, what about tailcall out of a block?
> 
> foo:
>   ^[^self bar]
> 
> Is that a different bytecode?

Tail call out of a block would be harder because the caller's receiver
(the block) (which we are replacing) holds the return context and
callee's (#bar) localReturns would have to be changed to a remoteReturns.
So a new method would have to be made on the fly and the receiver
would have to be wrapped in a new block closure with the return context.

Is tail recursion required for continuations?  I really don't understand
continuations, can you give me some pointers?

Cheers,
Anthony



More information about the Squeak-dev mailing list