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

call/cc and proper tail recursion



It seems that I did not receive the intervening discussion spawned by my
comment.  Here are a few points I want to make...

1) From the report (r4rs) I wasn't sure what the correct semantics
should be.  The first system I tried my example on was MIT-Scheme and
it ran out of stack/heap space.  The correct semantics should be
explicited in the next report since call/cc plays a fundamental role.

2) The thing that got me interested in the tail recursive property of
call/cc is the implementation of dynamic binding.  For call/cc to work
properly with dynamic binding, the dynamic environment must be saved
inside the continuation captured by call/cc (so that the correct
dynamic environment can be restored when the continuation is resumed).
A naive implementation of dynamic binding will make call/cc non-tail
recursive.  I just want the people working on dynamic binding to know
about this potential problem (is there a group in charge of this
anyway??).  Note: contrary to the dynamic-wind construct, the dynamic
binding construct can be tail recursive.

Marc