On Sun, Mar 26, 2017 at 03:03:02PM +0200, Jörg F. Wittenberger wrote:
>  (include "../mechanism/notation/Lalr/lalr-gen.scm");;[1]
> 
>  (define-syntax lalr-parser
>    (er-macro-transformer
>     (lambda (x r c)
>       (apply gen-lalr-parser (cdr x)))))
> 
[...]
> (module mystuff * 
> (import lalrgen) (import-for-syntax lalrgen)
> ...
> 
> Error: during expansion of (lalr-parser9196 ...) - unbound variable:
> gen-lalr-parser
> 
> How should this work?

Try

(begin-for-syntax (include "../mechanism/notation/Lalr/lalr-gen.scm"))
(define-syntax lalr-parser ...)

> [1]: This lalr-gen.scm is a big cond-expand on the scheme implementation
> defining among other things a syntax `logical-or` as alias to
> logical-ior and uses these definitions in the procedure
> gen-lalr-parser, which does the macro actual expansion.  The
> implementation of the latter contains the reference to the renamed
> logical-ior.  In other words: it's missing at expansion time.

This was the crucial insight that was missing from your previous post.

Cheers,
Peter

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to