Created
March 31, 2014 14:42
-
-
Save kencoba/9893923 to your computer and use it in GitHub Desktop.
SyncStitch:Train Gate Controll ref: http://qiita.com/kencoba/items/82a0ff70737a6c150148
This file contains 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-event f.enter) | |
(define-event f.exit) | |
(define-event b.enter) | |
(define-event b.exit) | |
(define-event c.open) | |
(define-event c.close) |
This file contains 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-channel ch-fc (x) '((0))) | |
(define-channel ch-bc (x) '((0))) | |
(define-channel ch-cg (x) '((0) (1))) | |
(define-process SYS | |
(par '() FRONT BACK CTRL-CLOSE)) | |
(define-process FRONT | |
(! f.enter (! ch-fc (0) (! f.exit FRONT)))) | |
(define-process BACK | |
(! b.enter (! b.exit (! ch-bc (0) BACK)))) | |
(define-process CTRL-CLOSE | |
(? ch-fc (x) (! c.open | |
(? ch-bc (x) (! c.close CTRL-CLOSE))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment