如何在方案中导入模块?

哈里·凯恩

我是新手。我正在尝试在计划中导入模块“排序”。我尝试了从(负载排序)到(开放排序),(导入排序)的所有操作。我能够使用

,open sorting 

当我在计划bash。但是我想将模块导入方案文件。我正在使用scheme48

邓肯

您需要使用模块语言。

可以在这里找到更多详细信息:http : //community.schemewiki.org/?scheme48-module-system

基本上,不只是编写一个普通的方案文件,而是foo.scm:

;; foo.scm
(define (hello) (display "Hello World!"))

您需要使用模块语言

;; foo2.scm

;; this is not scheme, it's the module language
(define-structure hello (export hello)
  (open scheme)
  ;; or others here
  (begin
    ;; this is Scheme
    (define (hello) (display "Hello World!"))))

您可以在此处了解有关模块语言的更多信息:http : //s48.org/1.8/manual/manual-ZH-5.html

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章