Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What's bad about Python?

Name: Anonymous 2005-12-21 8:09

Because I'm learning it, almost done through the tutorial, and it looks great.

Name: Anonymous 2011-07-27 0:12

>>199
You can't in CL; you need Scheme and its realized continuations for that. Here's how you might do it:

(define (make-generator fun)
  (let ((current #f))
    (lambda ()
      (call-with-current-continuation
       (lambda (outer)
     (if current
         (begin (current))
         (begin (fun (lambda (value)
               (call-with-current-continuation
                (lambda (inner)
                  (set! current inner)
                  (outer value)))))
            (call-with-current-continuation
             (lambda (end)
               (set! current end)))
            (throw 'no-more))))))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List