Here's what I take to be a (scheme) prototype of Matthijs' "success continuations" approach. It actually works mostly by passing closures and a state object, ...
Matthijs -- is this what you're describing?
It sounds like approach #2 ("callback") I listed in my original post
Unfortunately, #1 is the more appealing approach of the two and is what this whole thread has been about so far. I pretty much abandoned #2 early on.
I'll see if I can take a look at it later.
#2's only advantage was that - as you noted - it doesn't need continuations for backtracking, but uses the normal call-chain.
I've never really done anything with scheme but I know the syntax mostly, so I'll see if I can read it later on -- you obviously put quite some effort in writing it, so it deserves to be read :-)
Dan -- given that the "real one" could optimize simple operators by putting a bunch of them inside a single sub, does this look too painful?
I doubt he'll like this -- while the continuations-model is still mostly like his model (structurally), the callback-model isn't. I also think it has less opportunity for optimizations but I might be wrong about that.
-- Matthijs van Duin -- May the Forth be with you!