[plt-scheme] Re: [Larceny-users] side effects in R6RS modules

From: Michele Simionato (michele.simionato at gmail.com)
Date: Tue May 5 00:19:07 EDT 2009

On May 4, 9:06 am, Michele Simionato <michele.simion... at gmail.com>
> I am still confused ...

Aziz explained what is happening. Ikarus visits a module
and re-evaluate its syntax definitions only if that module
exports a macro which is actually *used*. The dummy macros
are not exported nor used in the script, so defines.sls is not
visited. If we add to defines.sls  a macro such as the following

;; put this in defines.sls
(define-syntax visit-defines
  (lambda (x) "visited"))

we export it, and we *call* it in x.ss, then everything works
and side effects survive separate compilation. The same code
works even on Ypsilon. So it looks like it is possible to
use Matthew Flatt's trick in all R6RS implementation, but
one must take extra care in Ikarus, because the compiler is
very smart (those smart kids!)

          Michele Simionato

Posted on the users mailing list.