next up previous
Next: 4.2 Using J Notation Up: 4 Expressing Recursion as Previous: 4 Expressing Recursion as

4.1 Using Scheme Notation

The five continuations are:

(define c1
  (lambda(n) (+ 5 n)))
(define c2
  (lambda(n) (+ 4 n)))
(define c3
  (lambda(n) (+ 3 n)))
(define c4
  (lambda(n) (+ 2 n)))
(define c5
  (lambda(n) (+ 1 n)))

Then the value of (sum 5) may be written as

(c1 (c2 (c3 (c4 (c5 0)))))


next up previous
Next: 4.2 Using J Notation Up: 4 Expressing Recursion as Previous: 4 Expressing Recursion as
2002-11-26