Eduardo Cavazos wrote:

(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).

Aziz,

Check out this transcript with Ypsilon:

Ypsilon 0.9.6-trunk/r503 Copyright (c) 2009 Y.Fujita, LittleWing Company Limited.
> (import (b))

> (b)

10

;; Here I went and changed 'x' to return 100.

> (load "/scheme/a.sls")

> (b)

100

;; Jeah booooiii

;; Note that 'a' is still not in the repl environment

> a

error: unbound variable a

;; Start the thread:

> (spawn
   (lambda ()
     (let loop ()
       (display (b))
       (newline)
       (usleep 1000000)
       (loop))))

100
> 100
100
100
100
100

;; Here I change 'x' back to returning 10.

;; Reload 'a.sls' at this point via C-c C-l

> 10
10
10
10
10
10

Boo-yah! ;-)

Ed

Reply via email to