[plt-scheme] On continuations...

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Dec 17 17:48:05 EST 2004

John, I think michael wants macros so that

(def part (n)
      (if (= n 0)
          (yield empty)
          (return #f))
      (for-each-yield part (- n 1)
                      (lambda (p)
                        (yield (cons 1 p))
                        (if (and (pair? p) (or (null? (cdr p)) (< (car 
p) (cadr p))))
                            (yield (cons (+ 1 (car sp)) (cdr sp)))))))

works. Daniel? -- Matthias

P.S. The macros are left as an exercise to the reader. Hint: use 
syntax-case. 



Posted on the users mailing list.