Skip to content

Instantly share code, notes, and snippets.

@NalaGinrut
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NalaGinrut/9889971 to your computer and use it in GitHub Desktop.
Save NalaGinrut/9889971 to your computer and use it in GitHub Desktop.
yy research code
(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