From 1117ce0d06e0187547fcca53f50d3484665f1cab Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 9 Dec 2005 22:00:13 +0000 Subject: [PATCH] avoid 'begin' for the stepper's sake svn: r1574 --- collects/htdp/world.ss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collects/htdp/world.ss b/collects/htdp/world.ss index 1127ecf331..61303b8f90 100644 --- a/collects/htdp/world.ss +++ b/collects/htdp/world.ss @@ -230,7 +230,7 @@ (define-syntax (update s) (syntax-case s (produce) - [(_ pict produce exp) (syntax (begin (update-frame pict) exp))] + [(_ pict produce exp) (syntax (update-frame/proc pict (lambda () exp)))] [(_ pict pict2 ... produce exp) (raise-syntax-error 'update "you can place only one picture in the canvas" s)] [(_ stmt produce) @@ -240,6 +240,11 @@ [_ (raise-syntax-error 'update "use as (update produce )")])) + (define (update-frame/proc pict thunk) + (begin + (update-frame pict) + (thunk))) + (define (update-frame pict) (unless the-frame (error 'update SEQUENCE-ERROR)) (check-result 'update (lambda (x) (beg:image? x)) "image" pict)