[plt-scheme] Incremental development with DrScheme or MzScheme

From: Austin King (shout at ozten.com)
Date: Wed Oct 3 19:59:33 EDT 2007

Thanks for your help.

I read
Chapter 5 Modules from PLT MzScheme Language Manual and
Chapter 55 unit.ss from PLT MzLib: LIbraries Manual

I am still not able to do interactive development, where changes in
one DrScheme window are picked up by a running MrEd window.

After reading about modules, I tried this:
; new window Language "Pretty Big (includes MrEd and Adv Student)"
; in module-lib.scm
(module module-lib
  (define (foo)
  (provide foo))
; clicked run

; new window
; in module-test.scm
(module module-test  mzscheme
  (require "module-lib.scm")
  (define (test-foo)
    (display "Hello ")
    (display (foo))(newline)
    (sleep 1)

  (provide test-foo))

(require module-test)

; click run
; The interaction window starts printing "Hello bar" over and over

; go back to module-lib window and change
  (define (foo)
  (define (foo)
; click run
 switch back to module-test.scm window and look at interaction window...
 it is still printing "Hello bar"
 I expected it to change to "Hello foo"

Is this possible with DrScheme or MzScheme?

On 10/3/07, Chongkai Zhu <czhu at cs.utah.edu> wrote:
> Please check the doc about ``module'' and ``unit''.
> Austin King wrote:
> > Howdy,
> > I would like to start a long running process and then redefine parts
> > of the Scheme code, recompile, and have the long running process pick
> > up these changes.
> >
> > My understanding is that DrScheme Run button cleans out the
> > environment for the "Definitions" and "Interactions" windows. Is this
> > correct? Clicking 'Run', I see it kill my running GUI and start a
> > fresh copy.
> >
> > Should I use (load "foo.scm") from the interactions window to reload
> > changed code? For partial load/compilation just copy and past s-exp
> > that I want to re execute?
> >
> > I am looking for something like SLIME+sbcl where I can compile an
> > s-exp and this immediately shows up in the running environment. If
> > this isn't possible, then a pointer to good workflow for DrScheme.
> > Thanks.
> >
> > Congratulations on an excellent project.
> >
> >

Thanks much,

Posted on the users mailing list.