gambit中缺少方案格式功能



我试图运行以前使用Guile运行的Gambit Scheme脚本。我注意到Gambit失败了,因为它缺少"格式"函数。

格式不是方案的一部分吗?

(format #t "example(~a)=<~a>n" i (example i))

相反,我将Gambit脚本修改为以下内容。

(display (string-append "example(" (number->string i) ")=<" (number->string (example i)) ">n"))

我在这里想念什么?谢谢。

在gambit中您可以使用标准R7RS库,并且需要导入包含格式功能的SRFI-28。

(import (srfi 28))

但是,SRFI-28定义的方案格式函数没有像普通嘴唇那样打印到stdout的#t参数。第一个参数始终是输出字符串模式:

(display (format "example(~a)=<~a>n" i (example i)))
(newline)

最新更新