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

Lewis lewis1711 at gmail.com
Thu Feb 3 04:06:55 EST 2011


Adrien,

No I did not try and define them myself. I am obviously a scheme novice.

Googling revealed to me that these are two very well known macros. It
failed to bring up an implementation or a SRFI-number.

If you know where one should look, perhaps you could share a link.

On 03/02/2011, Adrien Piérard <pierarda at iro.umontreal.ca> wrote:
> 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