Hi all,
> ... > > Note that the `define-module' form at the top is related to the error > -- without it, both examples work just fine. (Wild speculation: Is it > possible that in the context of changes to the "current module" that > `define-syntax' puts bindings in a place different from where the > expander is looking for them?) Some (potentially misguided) digging around in psyntax.scm suggests that changes to the current module (via `eval-when' forms, e.g.) indeed are not properly reflected in the expansion environment within "chi-top-sequence" because of re-use of the hygiene structure (or "mod" as it's often referred to in psyntax). The problem goes away when I construct a fresh mod for expansion of each expression in the sequence: (define chi-top-sequence (lambda (body r w s m esew mod) (build-sequence s (let dobody ((body body) (r r) (w w) (m m) (esew esew) (mod mod)) (if (null? body) '() (let ((first (chi-top (car body) r w m esew (cons 'hygiene (module-name (current-module)))))) (cons first (dobody (cdr body) r w m esew (cons 'hygiene (module-name (current-module))))))))))) But that doesn't strike me as being the whole story. Anyone have some cycles to help me figure what the right thing to do is here? Thanks, Julian