# Calling into a Chez Scheme library from Racket -- imported symbol rewritten in vm-eval?

**URL:** <https://racket.discourse.group/t/calling-into-a-chez-scheme-library-from-racket-imported-symbol-rewritten-in-vm-eval/2257>\
**Category:** Questions & Answers\
**Tags:** question, ffi, chez\
**Created:** [August 28, 2023, 11:19pm UTC](https://racket.discourse.group/t/calling-into-a-chez-scheme-library-from-racket-imported-symbol-rewritten-in-vm-eval/2257 "2023-08-28T23:19:33Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)\
**Post date:** [August 31, 2023, 1:26pm UTC](https://racket.discourse.group/t/calling-into-a-chez-scheme-library-from-racket-imported-symbol-rewritten-in-vm-eval/2257/9 "2023-08-31T13:26:42Z")

</div>

I think the problem is how Racket adjusts `import` expansion via the `expand-omit-library-invocations` parameter. You can restore it while evaluating like this:

```scheme
#lang racket
(require ffi/unsafe/vm)

(define call-with-import-working
  (vm-eval '(lambda (thunk)
              (call-with-system-wind
               (lambda ()
                 (parameterize ([expand-omit-library-invocations #f])
                   (thunk)))))))

(call-with-import-working
 (lambda ()
   (vm-eval
    '((lambda () (import (foo)) (bar))))))

```

---

_[View the full topic](https://racket.discourse.group/t/calling-into-a-chez-scheme-library-from-racket-imported-symbol-rewritten-in-vm-eval/2257)._
