[plt-scheme] mzscheme behaviour differs between debian and gentoo

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Dec 25 16:00:59 EST 2008

On Dec 25, fschwidom at BigBix.localdomain wrote:
> > (define a (list 1 2))
> > (define b (list 3 4))
> > (append! a b)
> (1 2 3 4)
> > a
> (1 2)
> > b
> (3 4)
> 
> provides not the expected result (here running unter gentoo)
> 
> unter debian the output of 
> 
> > a
> 
> would be
> 
> (1 2 3 4)
> 
> what could the problem be?

In the newer versions (4.x) MzScheme switched to immutable pairs.
`append!' is usually defined as *possibly* changing the pairs to
attache the two lists -- but it doesn't have to do so.  (This is the
case with srfi-1, which I assume is what you're using.)  This means
that in the new version, `append!' is defined as `append', and you're
wrong to expect the mutation to happen.

As for Debian, I suspect that the default PLT version is an old one,
from before the immutable lists change.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.