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

18 paparan
Langkau ke mesej pertama yang belum dibaca

Andrew Wilcox

belum dibaca,
27 Ogo 2023, 8:06:31 PTG27/08/23
kepada Racket Users
I have a Chez Scheme library "foo.ss":

(library (foo)
   (export bar)
   (import (rnrs))

   (define (bar) "hello"))


From Chez Scheme:

$ chezscheme
Chez Scheme Version 9.5.4
Copyright 1984-2020 Cisco Systems, Inc.

> (eval '((lambda () (import (foo)) (bar))))
"hello
"


A Racket program "call.rkt" which attempts to use the library:

#lang racket

(require ffi/unsafe/vm)

(vm-eval
 '((lambda () (import (foo)) (bar))))


$ racket call.rkt
variable bar554 is not bound
  context...:
   body of "/home/andrew/prj/audit/compile/call.rkt"


What would be the right way to do this?

Thank you,

Andrew

Balas kepada semua
Balas kepada pengarang
Kirim Semula
0 mesej baharu