在Chicken Scheme模块中导入SRFI

时间:2017-07-23 17:58:42

标签: module chicken-scheme srfi

我想知道为什么这不起作用:

(module testModule (sayHello)
  (import chicken scheme)

  (define (sayHello)
    (format #t "Hello\n")))

当我使用csi启动此文件时,它会说:

  

警告:在:

中引用可能未绑定的标识符`format'

here写的是srfi-28(其中format是内置的)。的确,如果我试试这个......

(module testModule (sayHello)
  (import chicken scheme)
  (use srfi-28)

  (define (sayHello)
    (format #t "Hello\n")))

......它说:

  

错误:(导入)扩展期间(导入...) - 无法从未定义模块导入:srfi-28

为什么呢?如何创建使用SRFI 28的模块?

我还尝试通过chicken-install安装srfi-28但是鸡蛋不存在。

1 个答案:

答案 0 :(得分:1)

Mea culpa,问题是单位srfi-28不存在。 我只是解决了导入实现extras函数的format单元。

(module testModule (sayHello)
  (import chicken scheme)
  (use extras)

  (define (sayHello)
    (format #t "ciao")))