[plt-scheme] Re: 369.2

From: Kyle Smith (airfoil at bellsouth.net)
Date: Thu Dec 21 20:48:51 EST 2006

Matthew Flatt <mflatt at ...> writes:

> This change greatly simplifies the implementation of the REPL --- that'
> s what prompts are for, after all --- and it makes a lot more things
> work, such as
> 
>     > (define k #f)
>     > (thread (lambda () (let/cc id (set! k id))))
>     #<thread>
>     > (sleep 0.1)
>     > (k 1 2 3)
>     1
>     2
>     3

My Results:

Welcome to DrScheme, version 369.2-svn21dec2006.
Language: Pretty Big (includes MrEd and Advanced Student) custom.
> (define k #f)
> (thread (lambda () (let/cc id (set! k id))))
#<thread>
> (sleep 0.1)
> (k 1 2 3)
. continuation application: attempt to cross a continuation barrier


> Changing the load handler makes `load' behave like the REPL: you can
> put the REPL expressions above in a file, and they work the same when
> you load the file. Also, you can load something like
> 
>     (define k (let/cc k k))
>     (thread (lambda () (k 2)))
>     (sleep 0.1)
> 
> and `k' will get set to 2 with no "the port is closed" error.

Loading this file does indeed produce a k bound to 2.
 
Matt, at least for now, I could only find the one discrepancy.  I haven't 
checked struct's as ports, or the implications of having prompts around top-
level begin forms.

Cheers.

--kyle

Kyle Smith
airfoil at bellsouth dot com
schemekeys.blogspot.com





Posted on the users mailing list.