picrin/contrib/50.for/piclib/for.scm

31 lines
535 B
Scheme
Raw Normal View History

2014-06-27 22:32:23 -04:00
(define-library (picrin control list)
(import (scheme base)
2014-07-17 03:17:47 -04:00
(picrin control))
2014-06-27 22:32:23 -04:00
(define unit list)
(define (bind m f)
(apply append (map f m)))
(define-syntax reify
2014-06-27 22:32:23 -04:00
(syntax-rules ()
((_ expr)
(reset (unit expr)))))
2014-06-27 22:32:23 -04:00
(define (reflect m)
(shift k (bind m k)))
2014-06-27 22:32:23 -04:00
(define zero '())
2014-06-27 22:32:23 -04:00
(define plus append)
(export unit
bind
zero
plus
reify
reflect
(rename reify for)
(rename reflect in)
(rename unit yield)))