【发布时间】:2012-05-13 11:08:16
【问题描述】:
我编写了以下示例,试图在 Chibi Scheme 0.5.3 中试验 R7RS 库:
(define-library (example hello)
(export hello-world)
(import (scheme base))
(begin
(define (hello-world) "hello, world")))
(import (scheme write)
(example hello))
(write (hello-world))
不幸的是,在执行时,它会生成一个关于未定义变量的错误:
$ chibi-scheme hello.scm
ERROR: undefined variable: hello-world
我一定是犯了一个简单的错误,但没有看到。有什么想法吗?
【问题讨论】:
-
我认为你不需要从图书馆开始
-
@RossLarson:我认为
begin是R7RSdefine-library表单的一部分,并指定了库的内容。 -
@ChrisJester-Young - 对,
begin是规范的一部分,用于 R7RS 示例和 Chibi 的库。 -
确实如此,我很抱歉。现在我想,我的经验是使用 r6rs 库,只是使用 (library ...) 并且相当有限。 (幸好我没有把它作为答案发布,哈哈)
标签: scheme chibi-scheme r7rs