[gambit-list] Reference implementation of SRFI-1 List Library

Adrien Piérard pierarda at iro.umontreal.ca
Thu Feb 3 00:24:48 EST 2011


2011/2/3 Lewis <lewis1711 at gmail.com>:
> Thanks Marc,
> Unfortunately compiling that srf-1.scm contained therein resulted in
> the exact same errors. I used
> gsc -dynamic srfi-1.scm
> as specificied by the compile script.

The readme says it only works well with the interpreter.


> *** WARNING -- Variable ":optional" used in module "1-list-library.o1"
> is undefined
> *** WARNING -- Variable "let-optionals" used in module
> "1-list-library.o1" is undefined

They are indeed undefined.
Did you try to define them yourself?
If you don't understand the code, a little googling should tell you
what they do…

It's just two very simple macros.
Here's the first (not tried, not guaranteed):

(define-macro (:optional foo bar)
  `(let ((x ,foo)) (if (pair? x) (car x) bar)))

For what the second is and does, google is your friend. I think found
it immediately.

P!



-- 
Français, English, 日本語, 한국어



More information about the Gambit-list mailing list