[Ecls-list] ECL and destructive operations: problem?

Pascal Bourguignon pjb at informatimago.com
Sat Nov 14 23:36:44 UTC 2009


> ECL's outcome is:
> (defparameter *list-1* (list 1 2))
> (defparameter *list-2* (list 3 4))
> (defparameter *list-3* (append *list-1* *list-2*))
> *list-1*                  ==> (1 2)
> *list-2*                  ==> (3 4)
> *list-3*                  ==> (1 2 3 4)
> (setf (first *list-2*) 0) ==> 0
> *list-2*                  ==> (0 4)     ; as expected
> *list-3*                  ==> (1 2 3 4) ; woops!
> </code>
>
>
> When I test the same example on CLISP the outcome is exactly the same as 
> the
> book's outcome.
>
> So, is this a problem or am I missing something?

Yes, this is a problem APPEND is specified to return a list whose tail is 
the last argument.

-- 
__Pascal Bourguignon__





More information about the ecl-devel mailing list