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: Jörg F. Wittenberger
Subject: Re: [Chicken-hackers] Howto -extend chicken-5?
Date: Sun, 26 Mar 2017 15:03:02 +0200

Am Sat, 25 Mar 2017 21:13:10 +0100
schrieb Peter Bex <address@hidden>:

> On Sat, Mar 25, 2017 at 09:07:21PM +0100, Jörg F. Wittenberger wrote:
> > Am I doing something wrong, which should not have been working in
> > chicken4 either?  How should I fix this?  
> 
> You probably need to add (import (chicken bitwise)).

Nah, thanks for the suggestion, but this is not enough.

Neither importing it into the module exporting the macro nor importing
chicken.bitwise in the module before using the macro helps.

Maybe it's chicken.bitwise, which may(ormaynot-dunno) be not effective
for code loaded using -extend?[1]

But maybe this is not worth to be considered.  I did not like the
use of -extend anyway.  It was just the only way I found years ago.

Actually I'd like to get rid of that and have a normal module.  Removed
the -extend option from the compile command and... somehow I'm to
stupid to get that done:

(module
 lalrgen
 (
  (lalr-parser gen-lalr-parser)
  gen-lalr-parser
  )

 (import scheme chicken)
 (import chicken.pretty-print chicken.bitwise)

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

Thanks so much.

/Jörg


[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.



reply via email to

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