Hello again,

> Does this sound plausible?  I spent most of this past weekend trying
> to grok this and work around it (via various `eval'-based
> incantations) without much luck.  (The weird part is, I don't recall
> this happening with my old `(ice-9 r6rs-libraries)' module
> implementation, but I could be wrong.)

In case it's helpful, I've distilled the problem down to the following
self-contained example:

(define-module (foo))
(define-syntax foo
  (lambda (stx)
    (syntax-case ((_ x) (syntax (display x))))))
(foo 'bar)

...which has the side-effect of outputting the string "'bar" when
loaded from disk, whereas the following:

(begin
  (define-module (foo))
  (define-syntax foo
    (lambda (stx)
      (syntax-case ((_ x) (syntax (display x))))))
  (foo 'bar))

...produces the following error:

  ERROR: In procedure vm-debug-engine:
  ERROR: Wrong type to apply: #<syntax-transformer foo>

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?)


Regards,
Julian


Reply via email to