2014-06-27 22:32:23 -04:00
|
|
|
(define-library (picrin control list)
|
|
|
|
(import (scheme base)
|
|
|
|
(picrin control)
|
|
|
|
(scheme write))
|
|
|
|
|
|
|
|
(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))
|
|
|
|
|
2014-06-27 23:07:56 -04:00
|
|
|
(define (null . x)
|
|
|
|
'())
|
|
|
|
|
|
|
|
(export for in yield null))
|