Last active
August 29, 2015 14:04
-
-
Save lune-sta/fb49e796e56f4c29a195 to your computer and use it in GitHub Desktop.
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
| (define-syntax-rule | |
| (CGpipeline cg prev-value init-value body ...) | |
| (match cg | |
| [(CG id np pls) | |
| (define (send-value v) | |
| (place-channel-put (list-ref pls (add1 id)) v)) | |
| (define prev-value | |
| (if (= id 0) | |
| init-value | |
| (place-channel-get (car pls)))) | |
| (define result (begin body ...)) | |
| (unless (= id (sub1 np)) (send-value result)) | |
| result])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment