guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: r6rs standard libraries


From: Julian Graham
Subject: Re: r6rs standard libraries
Date: Wed, 24 Feb 2010 00:47:33 -0500

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]