I wrote a small Schema interpreter in C # and realized that the way I implemented it, it was very easy to add support for the right sequels.
So, I added them ... but I want to "prove" that they added them correctly.
The translator of My Scheme, however, does not have support for the “mutating” state - everything is the same.
So it was pretty easy to write unit test to bring up the continuation:
AssertEqual(Eval("(call/cc (lambda (k) (+ 56 (k 3))))"), 3);
However, I also want to write a unit test, which demonstrates that if the continuation is "slipping away" then it still works:
AssertEqual(Eval("(call/cc (lambda (k) k))", <some continuation>);
But, of course, the above will simply verify that “I have a sequel” ... no, that is really a valid continuation.
However, all the examples I can find always use "set!". to demonstrate accelerated sequel.
What is the simplest example of a scheme that demonstrates proper support for backward continuation without relying on a mutation?
Are reverse extensions any use without mutation? I am beginning to suspect that this is not so, because you can only use it to repeat the same calculation ... which is pointless if there are no side effects. Is this why Haskell has no sequels?
functional-programming haskell continuations scheme
Paul hollingsworth
source share