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

Re: remove



In <1992Nov23.161022.20210@mail.cornell.edu> Tim Larkin <tsl1@cornell.edu> writes:

> 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."