[<<][staapl][>>][..]
Mon Jun 23 08:14:22 CEST 2008

comprehensions + delimited control

Looks like a nice alternative to lazy lists. Screams for coroutines,
so might want to add some abstraction to it.

http://groups.google.com/group/plt-racket/browse_thread/thread/d0ff99391f9ac53f/f5de867c296afcbe?lnk=gst&q=yield#f5de867c296afcbe

(define (in-yielder f)
  (define end (list 1))
  (define i (iter f end))
  (make-do-sequence (lambda ()
                      (values (lambda (_) (i))
                              void void void
                              (lambda (e) (not (eq? end e)))
                              void))))
(for/list ([x (in-yielder (lambda (yield)
                            (for-each yield '(1 2 3))))])
          x)



[Reply][About]
[<<][staapl][>>][..]