[plt-scheme] Interacting w/ MzScheme

From: Robby Findler (robby at cs.uchicago.edu)
Date: Fri Dec 10 14:24:52 EST 2004

That gets you part of the way there but, for example, closing the inner
repl doesn't kill any threads or close any network ports it may have
started/opened. The paper I posted earlier is worth reading, if you're
interested in this.

Robby

At Sat, 11 Dec 2004 04:22:55 +0900, Daniel Pinto de Mello e Silva wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> On Fri, 10 Dec 2004 12:48:28 -0600, Pinku Surana <suranap at gmail.com> wrote:
> > What magic incantation will erase MzScheme's state without
> > restarting? DrScheme somehow does this.
> 
> I'm not sure if this is how DrScheme does it, but try this:
> 
> $ cat bah.ss
> (module bah mzscheme
>   (printf "bah!~n"))
> $ mzscheme
> Welcome to MzScheme version 299.22, Copyright (c) 2004 PLT Scheme, Inc.
> > (define ns1 (make-namespace 'initial))
> > (define ns2 (make-namespace 'initial))
> > (eval '(require "bah.ss") ns1)
> bah!
> > (eval '(require "bah.ss") ns1)
> > (eval '(require "bah.ss") ns2)
> bah!
> 
> So...
> 
> $ mzscheme
> Welcome to MzScheme version 299.22, Copyright (c) 2004 PLT Scheme, Inc.
> > (define (repl)
>    (printf "~n>> ")
>    (print (eval (read)))
>    (repl))
> > (define (toplevel)
>    (let/ec ec
>      (parameterize ([current-namespace (make-namespace 'initial)])
>        (namespace-set-variable-value! 'exit (lambda () (ec #f)))
>        (repl))))
> > (toplevel)
> >> 8
> 8
> >> 9
> 9
> >> (exit)
> #f
> > (toplevel)
> >> (require "bah.ss")
> bah!
> >>  (require "bah.ss")
> >> (exit)
> #f
> > (toplevel)
> >>  (require "bah.ss")
> bah!
> >>  (require "bah.ss")
> >>
> 
> Daniel



Posted on the users mailing list.