Open symingz opened 1 year ago
I believe this behavior is as described in the documentation of eval-when
. It's a bit dense but as I understand it the difference between load
and compile
is what happens when the .so is subsequently loaded. Then eval-when
with load
will be evaluated, but not compile
. But both will fire in the initial compilation.
I don't think so. Based on the precise description of eval-when
on page 354 and 355, define-syntax
, being a compile-time form, has {L, C}
as its state set if it is not inside eval-when
. Inside an eval-when
with (load)
as the situation list, the state set changes to {L/load, C/load}
, which, according to the table on page 355, is {L, -}
, or simply {L}
. A form with a state set of {L}
should not be evaluated at compile time.
Given a file
helloz.ss
with the following content:Running
(compile-file "helloz.ss")
from a fresh ChezScheme (9.5.8) interactive top level gives the following output:This indicates that the
define-syntax
form is evaluated during compilation despite the absence ofcompile
in the situation list ofeval-when
, which contradicts the description ofeval-when
in CSUG.