Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Scheme中从顶层使用自定义库(Racket 6.3)_Scheme_Racket - Fatal编程技术网

在Scheme中从顶层使用自定义库(Racket 6.3)

在Scheme中从顶层使用自定义库(Racket 6.3),scheme,racket,Scheme,Racket,按照中的说明,我可以构建一个库smcho.ss (library (smcho simple (1)) (export hello factorial) (import (rnrs (6))) (define (hello x) (+ x 10)) (define (factorial n) (cond [(<= n 0) 1] [else (* n (factorial (-

按照中的说明,我可以构建一个库
smcho.ss

(library (smcho simple (1))
    (export hello factorial)
    (import (rnrs (6)))

    (define (hello x)
      (+ x 10))

    (define (factorial n)
        (cond
            [(<= n 0) 1]
            [else (* n (factorial (- n 1)))]))
)
我有错误信息

scheme> plt-r6rs top_level.sc 
get-module-code: no such file: #<path:/Users/smcho/Desktop/scheme_lib/top_level.sc>
  context...:
scheme>plt-r6rs顶层.sc
获取模块代码:无此类文件:#
上下文…:
可能有什么问题?
我检查了
~/Library/Racket/6.3/collects
目录是否存储了正确编译的库,因此问题不应该来自库

问题是我应该使用
(display(factorial 10))
而不是
print
。此外,在DrracketGUI中,我需要添加
#lang r6rs
以在其中运行


打印
pr
导致问题时,我不确定为什么
显示
正常

问题是我应该使用
(display(factorial 10))
而不是
print
。此外,在DrracketGUI中,我需要添加
#lang r6rs
以在其中运行


打印
pr
导致问题时,我不确定为什么
显示
正常

Racket提供打印功能,但R6RS没有。R6RS标准仅定义
显示
。Racket提供
打印
功能,但R6RS不提供。R6RS标准仅定义
显示
scheme> plt-r6rs top_level.sc 
get-module-code: no such file: #<path:/Users/smcho/Desktop/scheme_lib/top_level.sc>
  context...: