On May 12, 2009, at 8:33 AM, Michele Simionato wrote:
$ ypsilon
Ypsilon 0.9.6-update3 Copyright (c) 2008 Y.Fujita, LittleWing
Company Limited.
(load "debug.scm")
(expand-r6rs "/home/micheles/gcode/scheme/use-foo.ss")
(macro-helper) invoked
(foo) invoked
(run-r6rs "/home/micheles/gcode/scheme/use-foo.ss")
1
So Ypsilon is instantiating the macro-helper, but only at compile-
time.
I don't think so. It gets instantiated at run time too. What you're
seeing
is the result of having both libraries already existing in the
running image
of ypsilon. You didn't expect to see the messages printed twice, did
you?
$ cat macro-helper.sls
(library (macro-helper)
(export helper)
(import (rnrs))
(define (helper stx) 12)
(display "macro helper invoked\n"))
$ cat foo.sls
(library (foo)
(export x)
(import (rnrs) (macro-helper))
(define-syntax s
(lambda (stx) (helper stx)))
(define x (s))
(display "foo invoked\n"))
$ cat use-foo.ss
#!r6rs
(import (rnrs) (foo))
(display "x=")
(display x)
(newline)
$ mkdir acc
$ ls acc
$ ypsilon --sitelib=. --acc=acc
Ypsilon 0.9.6-update3 Copyright (c) 2008 Y.Fujita, LittleWing Company
Limited.
> (load "debug.ss")
> (expand-r6rs "use-foo.ss")
macro helper invoked
foo invoked
> ^D
$ ls acc
foo.cache macro-helper.cache
foo.cache.time macro-helper.cache.time
$ ypsilon --sitelib=. --acc=acc
Ypsilon 0.9.6-update3 Copyright (c) 2008 Y.Fujita, LittleWing Company
Limited.
> (load "debug.ss")
> (run-r6rs "use-foo.ss")
macro helper invoked
foo invoked
x=12
> ^D
Aziz,,,