chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] Issue in -compile-syntax Was: Howto -extend chicken-5?


From: Jörg F. Wittenberger
Subject: [Chicken-hackers] Issue in -compile-syntax Was: Howto -extend chicken-5?
Date: Fri, 31 Mar 2017 11:42:04 +0200

Hi all,

turns out the culprit was the use of -compile-syntax

    $ csc -c -compile-syntax test-compile-syntax.scm

    Warning: reference to possibly unbound identifier `barize'

    Error: module unresolved: foo


I'm still changing import clauses all over the place.  It's going to
take time until I will see how much harm removing the -compile-syntax
did.

Test attached.

/Jörg

Am Sun, 26 Mar 2017 21:04:25 +0200
schrieb Peter Bex <address@hidden>:

> 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: test-compile-syntax.scm
Description: Text Data


reply via email to

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