chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] Howto -extend chicken-5?


From: Peter Bex
Subject: Re: [Chicken-hackers] Howto -extend chicken-5?
Date: Sun, 26 Mar 2017 21:04:25 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

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


reply via email to

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