I am trying to get a basic eval
to work within a library of the r7rs
egg. The following toplevel (not library) program work as I expected, when run with csi -R r7rs
:
(import (scheme base)
(scheme eval))
(eval '42 (scheme-report-environment 5))
This works for (null-environment 5)
, too (but not with the (environment '(scheme base) ...)
variant by the way). However, within a library:
(define-library (test-eval)
(import
(scheme base)
(scheme eval))
(export
my-eval)
(begin
(define (my-eval)
(eval '42 (scheme-report-environment 5)))))
I get
Error: module unresolved: test-eval
....
<syntax> [my-eval] (scheme-report-environment 5)
<syntax> (##core#begin)
<syntax> (##core#undefined) <--
What could be the problem? It seems there were some issues with R7RS environments in the Wiki, but I am not sure if that's related here.
Tested with chicken version 5.2.0 (homebrew package), both csi
and csc
.