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

Re: API conflicts

Shiro Kawai wrote:
> There's another point, though.  There are two camps in Scheme
> implementations regarding how to give the "fallback" value, both have
> their own ground.  If srfi-44 gives a convincing rationale for thunk
> approach, and becomes widely spread, it may be possible that
> eventually the convention of giving fallback value converges to thunk
> approach.

I've been thinking about this, and I'd rather raise an exception than
provide a failure thunk. SRFI-34 defines exceptions, and SRFI-35 style
conditions could provide information about the failure. It seems to me
that a language with sophisticated support for continuations should take
advantage of that in failure interfaces. It also simplifies call
interfaces, since you don't ever need to distinguish, "Is this procedure
a thunk or a collection datum?"

Unfortunately, SRFI-34 isn't quite implementable on some Schemes. For
example, PLT provides a RAISE primitive which is *almost* compatible
with SRFI-34, which means that it's tough to replace -- you can't
implement SRFI-44 with PLT RAISE, and existing code relies on the PLT
version, causing interoperability problems.
Bradd W. Szonye