continuation? not needed (in R7RS)
Peter McGoron 25 Sep 2026 00:15 UTC
In R7RS, a continuation is a procedure. Hence, if K is a continuation,
K
and
(lambda (x) (K x))
are indistinguishable. There isn't an operation one can do on a
continuation that is different than an operation that one can do on a
single-argument procedure. This is useful when one wants to implement
dynamic-wind atop of a call-with-current-continuation that does not
support it.
Now, some implementations *do* add operations that are done specifically
on continuations. The two types I know about are
* Marc Feeley's continuation API, seen in (chicken continuation) [1] and
in Gambit. These are not procedure objects, so (continuation? (call/cc
(lambda (x) x))) returns false.
* SRFI 226 [2]. In that SRFI, continuations are procedures.
This is to support operations such as
continuation-graft/call-in-continuation.
The details aren't important, but the point here is, a continuation?
predicate is only necessary when there are operations distinguishable
from procedures on continuations. One of those implementations is a
disjoint type from the continuations returned from call/cc, and the
other already has an SRFI associated with it. So continuation? is not
needed.
[1]:
https://wiki.call-cc.org/man/6/Module%20(chicken%20continuation)#continuation
[2]: https://srfi.schemers.org/srfi-226/srfi-226.html#inspection
-- Peter McGoron