From beb592d251e564e3cf734960fe576c7cda2ea559 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Fri, 11 Mar 2011 17:46:43 -0500 Subject: [PATCH] continuing to work on the call/cc linkage --- simulator-primitives.rkt | 4 ++-- test-compiler.rkt | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/simulator-primitives.rkt b/simulator-primitives.rkt index 6184f17..c2caaa0 100644 --- a/simulator-primitives.rkt +++ b/simulator-primitives.rkt @@ -29,7 +29,7 @@ (make-undefined)] )))))])) -(define my-callcc +(define call/cc (make-closure call/cc-label 1 '())) @@ -57,4 +57,4 @@ display displayln newline) - #:constants (null pi e))) + #:constants (null pi e call/cc))) diff --git a/test-compiler.rkt b/test-compiler.rkt index 91182f8..c9f7746 100644 --- a/test-compiler.rkt +++ b/test-compiler.rkt @@ -531,5 +531,9 @@ #:control-limit 1) +(test (let ([x 16]) + (call/cc (lambda (k) (+ x x)))) + 32) + ;(simulate (compile (parse '42) 'val 'next)) ;(compile (parse '(+ 3 4)) 'val 'next) \ No newline at end of file