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

will the real current continuation please stand up



I have a question for the Scheme philosophers, which relates somewhat
to pedagogy:  Why was CALL/CC designed in just the way it was?  In
particular, I tend to think of CALL/CC as "providing a way to grab
the current continuation," which makes especially good sense to those
familar with denotational semantics.  But then the immediate question
raised is, "why not just have a procedure CURRENT-CONTINUATION that,
when called with no arguments, returns the current continuation?"
The answer, of course, is that then no real "fork" in the processing
occurs, which brings up the following point:  In a sense CALL/CC does
*not* pass the current continuation to its argument; it passes the
continuation corresponding to the point *surrounding* the call to
CALL/CC.  The *real* current continuation is the one that passes control
to the functional argument to CALL/CC.

So my question is this:  Has anyone considered alternate ways of
providing the CALL/CC capability?  And does it make any sense at all
to use something like the CURRENT-CONTINUATION suggested above?
(I am *almost* convinced that I can't implement CALL/CC with
CURRENT-CONTINUATION, but maybe I haven't thought hard enough.)

    -Paul