7

I am trying to use srfi-1 in guile. I used the following code to include the srfi:
(use-modules (srfi srfi-1))

However, I get an error saying that srfi is probably undefined. How should I used srfi?

I tried googling this problem, but it seems that I am the first person with this problem.

Rohit Shinde
  • 1,575
  • 5
  • 21
  • 47
  • It works for me with Guile 2.0.11. What version of Guile are you using? – Nate C-K Feb 22 '15 at 10:52
  • I've posted an answer in the module case. But if you're actually writing a standalone program, make sure that the `use-modules` is at the top level, and isn't misspelt (e.g., as `use-module` or the like). – C. K. Young Feb 22 '15 at 16:41
  • I am writing a standalone program. I'll check it out. – Rohit Shinde Feb 22 '15 at 16:44

1 Answers1

9

(use-modules (srfi srfi-1)) is indeed the correct way to import SRFI 1, in top-level programs and in the REPL.

However, based on your previous question, I believe you may actually be writing a module instead, in which case the syntax is a little different. You'd use #:use-module (srfi srfi-1) inside your define-module. Example:

(define-module (my module)
  #:use-module (srfi srfi-1)
  ;; rest of the module declaration here
  )
C. K. Young
  • 219,335
  • 46
  • 382
  • 435