Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 guile 中使用 srfi-1。我使用以下代码来包含 srfi: (use-modules (srfi srfi-1))
(use-modules (srfi srfi-1))
但是,我收到一条错误消息,说 srfi 可能未定义。我应该如何使用 srfi?
我试着用谷歌搜索这个问题,但似乎我是第一个遇到这个问题的人。
(use-modules (srfi srfi-1))确实是在顶级程序和 REPL 中导入 SRFI 1 的正确方法。
但是,根据您之前的问题,我相信您实际上可能正在编写一个模块,在这种情况下,语法会有所不同。你会#:use-module (srfi srfi-1)在你的define-module. 例子:
#:use-module (srfi srfi-1)
define-module
(define-module (my module) #:use-module (srfi srfi-1) ;; rest of the module declaration here )