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

21 lines
363 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-syntax for
(syntax-rules ()
((_ expr)
(reset (lambda () expr)))))
(define (in m)
(shift (lambda (k)
(apply append (map k m)))))
(define (yield x)
(list x))
(define (null . x)
'())
(export for in yield null))