# Import for syntax transformer

**URL:** https://racket.discourse.group/t/import-for-syntax-transformer/2959
**Category:** General
**Created:** [June 9, 2024, 7:03pm UTC](https://racket.discourse.group/t/import-for-syntax-transformer/2959 "2024-06-09T19:03:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)
#### Post date: [June 9, 2024, 7:03pm UTC](https://racket.discourse.group/t/import-for-syntax-transformer/2959/1 "2024-06-09T19:03:24Z")

</div>

hello,  
i'm refactoring one of my project with modules in scheme , it is running on different implementations of scheme (guile,racket, kawa,...) , i try to use R6RS or R7RS for compatibility.  
I have many modules.  
One of them has a syntax transformer that reuse some variables of other modules but it fails to find them , because the syntax transformer eval variables in a different context than the one where my modules are imported .I suppose that  
when i see the error message:

`evaluating syntax transformer '$nfx$' threw unbound location: infix-operators-lst-for-parser-syntax`

the code of the macro `$nfx$` is this:

```scheme
 (define-library (nfx) ; R7RS

          (import 
              (n-arity)
              (infix-with-precedence-to-prefix)
              (operators))

              (export $nfx$) 

(define-syntax $nfx$

  (lambda (stx)
   
    (syntax-case stx ()
         (($nfx$ e1 op1 e2 op2 e3 op ...)  
               (with-syntax ((parsed-args (n-arity (!0-generic #'(e1 op1 e2 op2 e3 op ...) infix-operators-lst-for-parser-syntax (lambda (op a b) (list op a b))))))  

   #'parsed-args))))))) ; end module 

```

is there a way to make it run ? syntax transformer of `$nfx$` must know infix-operators-lst-for-parser-syntax which is in operators

---

<div class="post-metadata">

### Author: ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)
#### Post date: [June 10, 2024, 6:39am UTC](https://racket.discourse.group/t/import-for-syntax-transformer/2959/2 "2024-06-10T06:39:33Z")

</div>

Update: i'm thinking of a bug in Kawa scheme , i'm testing that.... (code goes forward when defining the variable in a let() in the syntax transformer - but i can not put all the code in it !) probably code would work in Racket or Guile but i have not yet port the code in a modular way in Racket. I'm checking and doing.......

---

<div class="post-metadata">

### Author: ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)
#### Post date: [June 11, 2024, 9:14am UTC](https://racket.discourse.group/t/import-for-syntax-transformer/2959/3 "2024-06-11T09:14:28Z")

</div>

Kawa bug confirmed. Should works without modification in Racket.Question was not relevant of Racket or Scheme.
