Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use SRFI-1 in Guile?

Tags:

scheme

guile

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.

like image 681
Rohit Shinde Avatar asked Feb 22 '15 10:02

Rohit Shinde


1 Answers

(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
  )
like image 121
Chris Jester-Young Avatar answered Sep 28 '22 07:09

Chris Jester-Young