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

call/cc and proper tail recursion



I think the report needs to clarify the tail recursive property of
call/cc.  Presently nothing is said about the behavior of this
simple program when it comes to tail recursion:

(define (foo) (call-with-current-continuation (lambda (k) (foo))))

In my mind, it should be equivalent to

(define (foo) (foo))

Thus call-with-current-continuation does not introduce any new
continuation frames.  The body of the procedure argument to call/cc
is evaluated with the SAME continuation as call/cc's continuation.

Some implementations do not conform to this specification, that is they
run out of space.

Marc