On Mon, May 4, 2009 at 10:24 AM, Abdulaziz Ghuloum
<aghul...@cs.indiana.edu> wrote:

> ... 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?

Because this is the behavior of PLT (and I am sure also of Larceny
with separate compilation).
With the fix Matthew Flatt committed in the trunk my original code
returns (a b).
I made a checkout of PLT and compiled it on scratch and checked it myself
(I have not checked with separate compilation but I expect it to give
the same result).
My explanation is that at visit time

(define+ a 1)

is expanded into

(begin
  (define-syntax dummy (begin (register #'name) (lambda (x) #f)))
  (define a 1))

and the register is populated again (it was populated
the first time the library was compiled, but then erased
by the multiple instantiation mechanism).

The trick of the dummy macro, which I have copied from the
Composable and Compilable paper, is there just to guarantee
side effects to survive across separate compilation, because
at visit time all modules are revisited. At least this is my
understing of how PLT/Larceny work.
If Ikarus does not work this way it seems that it is
impossible to rely on side effects to survive separate compilation.

This all a very tricky business, of course, and I may be missing something,

Reply via email to