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

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Thu Dec 25 16:02:38 EST 2008

fschwidom@ wrote:
> On Thu, Dec 25, 2008 at 01:53:21PM -0700, Jon Rafkind wrote:
>   
>> fschwidom at BigBix.localdomain wrote:
>>     
>>> Hi,
>>>
>>> the script:
>>>
>>>   
>>>       
>>>> (define a (list 1 2))
>>>> (define b (list 3 4))
>>>> (append! a b)
>>>>     
>>>>         
>>> (1 2 3 4)
>>>   
>>>       
>> Are you sure you invoked append! and not append? append! has been moved out 
>> of the core so you can't use it normally. What version of mzscheme are you 
>> running?
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>     
>
> $ mzscheme -v
> Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.
>
> before using "append!" i made "(require srfi/1)" because the
> documentation suggested it.
>   
Note that the srfi-1 documentation says

"|append!| is the "linear-update" variant of |append| -- it is allowed, 
but not required, to alter cons cells in the argument lists to construct 
the result list. The last argument is never altered; the result list 
shares structure with this parameter. "


In PLT's srfi-1 implementation append and append! are the same thing. If 
you really want to use append! (which I don't recommend) you can look at 
mappend! in the scheme/mpair library.


Posted on the users mailing list.