How do I use SRFI-1 in Guile?

guile, scheme

Solution

`(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
  )

Problem

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.

Original source