diff --git a/collects/htdp/world.ss b/collects/htdp/world.ss index e2e987f815..7f48a8ddd3 100644 --- a/collects/htdp/world.ss +++ b/collects/htdp/world.ss @@ -903,9 +903,11 @@ Matthew (queue-callback (lambda () (with-handlers ([exn:break? break-handler][exn? exn-handler]) - (set! the-world (f the-world e)) - (add-event KEY e) - (redraw-callback)))))) + (let ([new-world (f the-world e)]) + (unless (equal? new-world the-world) + (set! the-world new-world) + (add-event KEY e) + (redraw-callback)))))))) ;; f : [World Nat Nat MouseEventType -> World] ;; esp : EventSpace @@ -920,7 +922,7 @@ Matthew (when (and (<= 0 x WIDTH) (<= 0 y HEIGHT)) (with-handlers ([exn:break? break-handler][exn? exn-handler]) (let ([new-world (f the-world x y m)]) - (unless (eq? new-world the-world) + (unless (equal? new-world the-world) (set! the-world new-world) (add-event MOUSE x y m) (redraw-callback)))))))))