Created
August 1, 2012 11:02
-
-
Save yamasushi/3225803 to your computer and use it in GitHub Desktop.
chain of generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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