From d321c4e11713000cd385ea5ae78528d4e0a1f750 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Wed, 23 Jul 2014 11:13:20 -0400 Subject: [PATCH] Racket-y, 102 --- .../htdp-test/2htdp/tests/on-tick-defined.rkt | 24 ++++++++++--------- .../2htdp/tests/universe-restart.rkt | 6 +++-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/pkgs/htdp-pkgs/htdp-test/2htdp/tests/on-tick-defined.rkt b/pkgs/htdp-pkgs/htdp-test/2htdp/tests/on-tick-defined.rkt index 834028fa46..e7eea89d9d 100644 --- a/pkgs/htdp-pkgs/htdp-test/2htdp/tests/on-tick-defined.rkt +++ b/pkgs/htdp-pkgs/htdp-test/2htdp/tests/on-tick-defined.rkt @@ -49,21 +49,23 @@ (require 2htdp/universe) (big-bang 0 (on-tick add1) stop-when)))) -;; ----------------------------------------------------------------------------- +;; --------------------------------------------------------------------------------------------------- ;; purpose: catch illegal big-bang use w/o world expression -(with-handlers ((exn:fail:syntax? - (lambda (x) - (unless (string=? (exn-message x) "big-bang: expected an initial state, but found a clause") - (raise x))))) +(with-handlers + ((exn:fail:syntax? + (lambda (x) + (unless (string=? (exn-message x) "big-bang: expected an initial state, but found a clause") + (raise x))))) (eval '(module a scheme (require 2htdp/universe) - (big-bang (on-key add1))))) + (big-bang (on-key add1))))) -(with-handlers ((exn:fail:syntax? - (lambda (x) - (unless (string=? (exn-message x) "universe: expected an initial state, but found a clause") - (raise x))))) +(with-handlers + ((exn:fail:syntax? + (lambda (x) + (unless (string=? (exn-message x) "universe: expected an initial state, but found a clause") + (raise x))))) (eval '(module a scheme (require 2htdp/universe) - (universe (on-msg sub1) (on-new add1))))) + (universe (on-msg sub1) (on-new add1))))) diff --git a/pkgs/htdp-pkgs/htdp-test/2htdp/tests/universe-restart.rkt b/pkgs/htdp-pkgs/htdp-test/2htdp/tests/universe-restart.rkt index a2adec5d93..ccff809c75 100644 --- a/pkgs/htdp-pkgs/htdp-test/2htdp/tests/universe-restart.rkt +++ b/pkgs/htdp-pkgs/htdp-test/2htdp/tests/universe-restart.rkt @@ -16,7 +16,8 @@ (define (w n) (big-bang 3 - [to-draw (lambda (w) (overlay (text (number->string w) 22 'black) (circle 100 'solid 'red)))] + [to-draw (lambda (w) + (overlay (text (number->string w) 22 'black) (circle 100 'solid 'red)))] [on-tick (lambda (w) (if (<= w 1) (make-package 0 n) (- w 1)))] [register LOCALHOST] [port PORT-NO] @@ -46,7 +47,8 @@ (define (w n) (big-bang 3 - [to-draw (lambda (w) (overlay (text (number->string w) 22 'black) (circle 100 'solid 'red)))] + [to-draw (lambda (w) + (overlay (text (number->string w) 22 'black) (circle 100 'solid 'red)))] [on-tick (lambda (w) (if (= w 1) (make-package 0 n) (- w 1)))] [register LOCALHOST] [port PORT-NO]