previous up next     contents index
Next: Sharing Up: Donkey's Scheme Previous: Local

Call/cc

    When evaluating call/cc Donkey does several things:

  1. Donkey saves the current context which is exactly the text within the evaluation area with the hole replacing the call to call/cc. The hole of the context is represented by an empty square. Note that if you wish to hide the context (because it takes too much space) just click on its text. Donkey hides by default, but you can change this in the preferences menu (Section 4.3).
  2. The continuation returned by call/cc is given a name of the form c<number> and is placed in the Lifted Defs menu (Section 4.5). The value of the continuation is always expressed by its name and its associated context.
  3. From this point, the continuation is displayed as its name, and whenever it appears in a intermediate expression, its context is displayed at the top of the evaluation area.

When a continuation is applied, the current context is replaced by the continuations context with the application's argument filling the hole In Figure 2, for an example, after the next step, the intermediate expression will be:

(+ 1 2
 ( + 3 4 7))

   figure331
Figure 2: An example using call/cc