(define q (rlambda [call env esc cont] (p* ^cont) (normalize (arg 1 call) env esc cont))) (define p (lambda [cont-closure] (let [[env (closure-environment cont-closure)]] (binding 'cont env)))) (define p* (lambda [cont-closure] (letseq [[env (closure-environment cont-closure)] [vars (non-global-variables env)]] (print ps cont-closure cr) (do [[v vars (rest v)]] [[(null v) 'ok]] (print ps " " (first v) ": " (binding (first v) env) cr)) (if (member 'cont vars) (p* (binding 'cont env)) 'ok)))) (define non-global-variables (lambda [env] (if (last-contour env) [] (append (contour-variables env) (non-global-variables (previous-contour env))))))