[plt-scheme] I miss end-of-time...

From: Stephen Bloch (bloch at adelphi.edu)
Date: Sun Mar 14 09:15:03 EDT 2010

On Mar 13, 2010, at 7:36 PM, Matthias Felleisen wrote:

> On Mar 13, 2010, at 2:41 PM, Mark Engelberg wrote:
>> OK, I'm getting confused here.
>> 1.  What are the important differences between stop-with and end- 
>> of-time?
> 'stop-with' is just a constructor for a world, meaning (stop-with  
> 10) is just a special kind of world. You could introduce it via a  
> definition:
> (define lost-world (stop-with "you lost"))
> (define won-world (stop-with "you won"))
> And your event handlers could return one of these worlds as they  
> see fit:
> (define (mouse-handler w x y me) (if (= x 100) lost-world w))
> ;; ---
> end-of-time is an imperative command that shuts down the current  
> thread and custodian.

Some of the difference is behind-the-scenes implementation details of  
no interest to your students, but the above is a difference that they  
can see.  Related to it is the fact that "stop-with" can safely  
appear as the right answer in a check-expect, whereas "end-of-time"  

So I hereby correct the subject line: if I have "stop-with", I do NOT  
miss "end-of-time" :-)

Stephen Bloch
sbloch at adelphi.edu

Posted on the users mailing list.