On May 4, 2009, at 11:08 AM, Michele Simionato wrote:

No, I am still confused. I know that Ikarus visit a library only once,
so I expected to get (a b) and not (a b a b) but instead I get ()
if I use separate compilation!

Your first library, (experimental registry), does no compile-time side
effects and is easy to understand: it's a stash.

Your second library, (experimental define+), does no compile-time side
effects either, it just produces code that manipulate the stash.

Your third library is this:

(library (experimental defines)
  (export a b)
  (import (experimental define+))
  (define+ a 1)
  (define+ b 2))

If compiled separately from the script, it stashes (a b) in the registry
and that value is thrown away at the end of compilation.  Running the
script

#!r6rs
(import (rnrs) (experimental define+) (experimental defines))
(define-registered names)
(display names)

displays () because at the time the script is expanded, or at the time
when (define-registered names) is expanded, there is  nothing in the
registry.  Why did you expect to see (a b) here?

Aziz,,,

Reply via email to