views:

166

answers:

2

Hi All,

I need to understand Continuations in Scheme for my upcoming exams and I have no idea about continuations at all. Can anyone please suggest me sources of how to go about learning continuations?

Regards,

darkie

+2  A: 

I find this short draft tutorial a useful starting point. Once you grasp those very basics, a more extensive, Scheme-specific coverage is here; for a broader purview, wikipedia can be of some help (and has a few good links at the end).

Alex Martelli
Thanks Alex. I have a query from the link 'short draft tutorial'. The example has (+ 2 (call/cc (lambda (k) (set! handle k) 2))). Why do we have the rightmost 2 here? Is it because we need to associate the handle with continuation initially or is there some other reason to it?
darkie15
@darkie15, the rightmost `2` is the value the `call/cc` returns, making the expression result `4` (since that's `(+ 2 2)`!-); as a _side effect_, the `lambda` sets name `handle` to the continuation, so the short tutorial shows how to then treat `handle` like a function which performs `(+ 2 whatever)` on its argument `whatever`.
Alex Martelli
+3  A: 

I wrote this short article to make myself more acquainted with continuations. You may find it useful. I have also collected some links there.

Vijay Mathew