[plt-scheme] version 4 (4.1.3) newbie question

From: Dr. Johannes Brauer (brauer at nordakademie.de)
Date: Thu Nov 5 14:37:30 EST 2009

thanks for the elaborate explamations, some issues I figured out
myself in the meantime but ...
Am 05.11.2009 um 13:24 schrieb Jens Axel Søgaard:

> 2009/11/3 Johannes Brauer <brauer at nordakademie.de>:
>
> There are two different kinds of lists.
> The ones made with (good old) mutable cons-cells
> the new ones which are immutable.
>
>> #lang scheme
> This says that  ' should produce the kind of lists
> used in the the "scheme" language. That ' produces
> immutable cons cells.
>
> The filter in "scheme" expects immutable cells
> so this ought to work fine.
>
>> (require r5rs/init)
>
> But here you import the filter function from the language "r5rs/init".
> This filter function expects mutable cons-cells.
>
>> (list? (cons 1 '()))
>> (filter (lambda (x) (> x 5)) '(3 5 6 7))
>
> Here filter (the one expecting mutable cons-cells)
> is called with a list consisting of immutable cons-cells
> giving an error.
>
> That is, the functions in "scheme" and "r5rs" is difficult to mix.
>
> The easiest way to fix your program is to find out which PLT
> library where equivalent of the functions in r5rs/init you need is
> defined. For most functions, just search for the function name
> in the Help Desk.

...until now I could not found  a "configuration" which makes my
little 3.7-application running.
It uses set-car!, set-cdr!, assoc, filter, one of them is complaining,
however.

Johannes


Staatlich anerkannte private Fachhochschule
NORDAKADEMIE
Gemeinnützige Aktiengesellschaft
Köllner Chaussee 11
25337 Elmshorn

Vorstand:
Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. Jörg Meier (stellv. Vorstand)

Vorsitzender des Aufsichtsrats:
Dr. h.c. Hans-Heinrich Bruns

Sitz:
Elmshorn, Amtsgericht Elmshorn, HRB 1682



Posted on the users mailing list.