This commit is contained in:
Yuichi Nishiwaki 2013-12-03 22:29:35 +09:00
parent d9398828c0
commit 708af9f00f
1 changed files with 8 additions and 8 deletions

View File

@ -607,16 +607,16 @@
(lambda (expr use-env mac-env) (lambda (expr use-env mac-env)
(let ((wrapped '())) (let ((wrapped '()))
(define (inject obj) (define (inject obj)
(let ((s (make-syntactic-closure use-env '() obj))) (let ((s (make-syntactic-closure use-env '() obj)))
(set! wrapped (acons s obj wrapped)) (set! wrapped (acons s obj wrapped))
s)) s))
(define (extract obj) (define (extract obj)
(let ((t (assq obj wrapped))) (let ((t (assq obj wrapped)))
(if t (cdr t) obj))) (if t (cdr t) obj)))
(define (wrap expr) (define (wrap expr)
(walk inject expr)) (walk inject expr))
(define (unwrap expr) (define (unwrap expr)
(walk extract expr)) (walk extract expr))
(define (compare x y) (define (compare x y)
(identifier=? use-env x use-env y)) (identifier=? use-env x use-env y))
(make-syntactic-closure mac-env '() (unwrap (f (wrap expr) inject compare)))))) (make-syntactic-closure mac-env '() (unwrap (f (wrap expr) inject compare))))))