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