redefine shift and reset as syntaxes
This commit is contained in:
parent
b7bb3fa1cf
commit
3d170afac8
|
@ -27,6 +27,16 @@
|
||||||
(reset (lambda ()
|
(reset (lambda ()
|
||||||
(k v))))))))))
|
(k v))))))))))
|
||||||
|
|
||||||
(export shift
|
(define-syntax reset*
|
||||||
reset))
|
(syntax-rules ()
|
||||||
|
((_ expr ...)
|
||||||
|
(reset (lambda () expr ...)))))
|
||||||
|
|
||||||
|
(define-syntax shift*
|
||||||
|
(syntax-rules ()
|
||||||
|
((_ k expr ...)
|
||||||
|
(shift (lambda (k) expr ...)))))
|
||||||
|
|
||||||
|
(export (rename shift* shift)
|
||||||
|
(rename reset* reset)))
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,11 @@
|
||||||
|
|
||||||
(define-syntax for
|
(define-syntax for
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((_ expr)
|
((_ expr ...)
|
||||||
(reset (lambda () expr)))))
|
(reset expr ...))))
|
||||||
|
|
||||||
(define (in m)
|
(define (in m)
|
||||||
(shift (lambda (k)
|
(shift k (apply append (map k m))))
|
||||||
(apply append (map k m)))))
|
|
||||||
|
|
||||||
(define (yield x)
|
(define (yield x)
|
||||||
(list x))
|
(list x))
|
||||||
|
|
Loading…
Reference in New Issue