[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: remove



> > On the other hand, Common Lisp, the Manual, states that "the result [of 
> > remove] is a copy of the input sequence." If you return part of the 
> > original list, then you change the contract of the function. Sometimes 
> > one uses remove and requires a totally new list. One must be careful 
> > about "efficiency".
> 
> I was just about to post exactly this response until, in a stunning
> (for me) display of scholarship, I read a page further in the
> reference and discovered what seems to me like an inconsistency in the
> defined semantics of the function. (CLtL2, pg 400):
> 
>   "The result of REMOVE may share with the argument; a list result may
>    share a tail with an input list, and the result may be eq to the
>    input sequence if no elements need to be removed."

The use of the phrase "is a copy" is only intended to emphasize the immediately 
preceding statement that the function is non-destructive.  The dpANS uses 
wording that avoids this bit of confusion.