Last active
August 29, 2015 13:57
-
-
Save NalaGinrut/9889971 to your computer and use it in GitHub Desktop.
yy research code
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 (yy-print fmt . args) | |
;; if Guile | |
(apply format #t fmt args) | |
;; if Racket | |
;;(apply printf fmt args) | |
) | |
(define (inc x) | |
;; if Guile | |
(1+ x) | |
;; if Racket | |
;;(add1 x) | |
) | |
(define c | |
(reset | |
(let* ((yin-cnt 0) | |
(yin | |
((lambda (cc) | |
(shift k k) | |
(yy-print "@[~a] " yin-cnt) | |
(set! yin-cnt (inc yin-cnt)) | |
cc) (call/cc (lambda (c) c)))) | |
(yang-cnt 0) | |
(yang | |
((lambda (cc) | |
(yy-print "*[~a] " yang-cnt) | |
(set! yang-cnt (inc yang-cnt)) | |
cc) (call/cc (lambda (c) c))))) | |
(yin yang)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment