From 2b0daee31c28168a057140ac4d679cc38a6b9b07 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Mon, 12 Jan 2009 22:22:08 +0000 Subject: [PATCH] svn: r13080 --- collects/2htdp/private/universe.ss | 3 ++- collects/2htdp/private/world.ss | 3 ++- collects/2htdp/test/world0-stops.ss | 5 +++++ collects/2htdp/universe.ss | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 collects/2htdp/test/world0-stops.ss diff --git a/collects/2htdp/private/universe.ss b/collects/2htdp/private/universe.ss index d170551ffa..7fc5426de7 100644 --- a/collects/2htdp/private/universe.ss +++ b/collects/2htdp/private/universe.ss @@ -61,7 +61,7 @@ (define u (bundle-state r)) (set! worlds (bundle-low r)) (set! universe u) - (unless (boolean? to-string) (send gui add (to-string u))) + (unless (boolean? to-string) (send gui add (to-string worlds u))) (broadcast (bundle-mails r)))))) (def/cback private (pmsg world received) on-msg) @@ -219,6 +219,7 @@ (provide world? ;; Any -> Boolean world=? ;; World World -> Boolean + world-name ;; World -> Symbol world1 ;; sample worlds world2 world3) diff --git a/collects/2htdp/private/world.ss b/collects/2htdp/private/world.ss index b45eaa0dd9..6daa9e326f 100644 --- a/collects/2htdp/private/world.ss +++ b/collects/2htdp/private/world.ss @@ -278,7 +278,8 @@ ;; ------------------------------------------------------------------------- ;; initialize the world and run (super-new) - (start!))))) + (start!) + (when (stop-when world) (stop! world)))))) ;; ----------------------------------------------------------------------------- (define-runtime-path break-btn:path '(lib "icons/break.png")) diff --git a/collects/2htdp/test/world0-stops.ss b/collects/2htdp/test/world0-stops.ss new file mode 100644 index 0000000000..a50c191bf2 --- /dev/null +++ b/collects/2htdp/test/world0-stops.ss @@ -0,0 +1,5 @@ +;; The first three lines of this file were inserted by DrScheme. They record metadata +;; about the language level of this file in a form that our tools can easily process. +#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname world0-stops) (read-case-sensitive #t) (teachpacks ((lib "universe.ss" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "universe.ss" "teachpack" "2htdp"))))) + +(big-bang 0 (stop-when zero?) (on-tick add1)) \ No newline at end of file diff --git a/collects/2htdp/universe.ss b/collects/2htdp/universe.ss index 9d691c54b3..f8182421f8 100644 --- a/collects/2htdp/universe.ss +++ b/collects/2htdp/universe.ss @@ -228,6 +228,7 @@ ;; type World world? ;; Any -> Boolean world=? ;; World World -> Boolean + world-name ;; World -> Symbol world1 ;; sample worlds world2 world3