Abdulaziz Ghuloum wrote:
Well, I'm not necessarily lobbying for this behaviour in Ikarus. But
this is a litmus test for the hardcore dynamic lanuage folks. I.e. can
they make a source change and have a running application reflect the
change. Smalltalk and Factor do this for example.
Dude, you can set! a variable, set-car! a pair, or vector-set! a vector,
and its effect is immediate everywhere, no? I don't get what this test
is all about.
Hi Aziz,
(library (a)
(export a)
(import (rnrs))
(define (a) (x))
(define (x) 10))
(library (b)
(export b)
(import (rnrs)
(a))
(define (b) (a)))
Suppose I've imported both of these into the repl. And let's say I've
started a thread which is printing the result of (b), once per second (I
know... Ikarus doesn't have threads, but for example).
Now say I want to change 'x' so that it returns 20, and have the
currently running thread reflect this change.
It seems non of the above suggestions (set!, set-car!, etc.) won't work
in this case.
If you could get into the internal environment of library (a) then
perhaps set! would work. I.e. (set! x (lambda () 20)).
What about 'uninstall-library'? My understanding is that even if you
uninstall library a and library b, and reimport them the thread won't be
affected.
Sure, I know that I could restructure make 'x' an exported parameter.
Ideally, I'd edit 'a.sls' in Geiser, hit some keystroke which means
"reload library" and the running thread (no cheating by restarting the
thread) starts to reflect the change.
Anyways, I know this isn't your style. But it is what some developers
want. Please consider accomadating them. :-)
Ed