hello,
i need to local eval some vars for an infix evaluator but i can not find a
way to use local eval in my context,here is an example that illustrate my
problem:
;; file Scheme+.scm
(define-module (Scheme+)
#:use-module (ice-9 local-eval)
#:export (eval-var))
(include-from-path "test-local-eval.scm"))
;; file test-local-eval.scm
(define-syntax eval-var
(syntax-rules ()
((_ var) (let ((env (the-environment)))
(local-eval (quote var) env)))))
when i test it i get an error because it can not evaluate the variable:
(use-modules (Scheme+))
scheme@(guile-user)> (define i 3)
scheme@(guile-user)> i
3
scheme@(guile-user)> (eval-var i)
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Unbound variable: i
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>
scheme@(guile-user) [1]> ,bt
In ice-9/eval.scm:
223:20 2 (proc #(#(#<directory (Scheme+) 7ff0327b20a0>)))
In unknown file:
1 (%resolve-variable (7 . i) #<directory (Scheme+) 7ff0327b20a0>)
In ice-9/boot-9.scm:
1669:16 0 (raise-exception _ #:continuable? _)
Regards,
Damien