Skip to content

Instantly share code, notes, and snippets.

@yamasushi
Created August 1, 2012 11:02
Show Gist options
  • Select an option

  • Save yamasushi/3225803 to your computer and use it in GitHub Desktop.

Select an option

Save yamasushi/3225803 to your computer and use it in GitHub Desktop.
chain of generator
(use gauche.generator)
(define (proc-a g yield)
(do-generator (x g)
(yield (* x 2))))
(define (proc-b g yield)
(do-generator (x g)
(yield (* x 3))))
(define g
(generate (pa$ proc-b
(generate (pa$ proc-a
(giota) ) ) ) ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment