[racket] changing source code with application still running

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Oct 10 09:45:20 EDT 2012

Racket does not generally support this scenario. You could get close by doing...

% racket
> (require "myapp.rkt")
> (run)
> (set-box! some-function-called-by-app (lambda (...) new implementation))

But it would be very inconvenient to box all functions you may want to
change and you'd have to remember to record all these changes in the
real source code.

(A box is necessary because module-imported identifiers are not set!-able.)


On Wed, Oct 10, 2012 at 7:25 AM, Daniel Bastos <dbastos at toledo.com> wrote:
> Here's a quote from Paul Graham --- quoting from
> http://bc.tech.coop/blog/040223.html.
> "When one of the customer support people came to me with a report of a
> bug in the editor, I would load the code into the Lisp interpreter and
> log into the users' account. If I was able to reproduce the bug I'd
> get an actual break loop, telling me exactly what was going wrong.
> Often I could fix the code and release a fix right away. And when I
> say right away, I mean while the user was still on the phone. "
> I have been trying to understand *how* this is done. I'd hope that
> this is also possible in Racket. But let me ask about the following
> specific situation.
> Say I have some application running. I told the shell
>      ./run_my_application &
> Now, while using it, I notice a bug somewhere. How do I change the
> code and see its new effect without shutting down and rerunning the
> application?
> Thank you.
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.