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

Re: remove



In article <HALTRAET.92Nov20091121@monsun.si.no> haltraet@monsun.si.no (Hallvard Tr{tteberg) writes:

>Remove conses up a new list even though it doesn't remove anything!

This is true in some implementations, but remove is allowed to
return a result that "shares structure" with the list it was given.
Indeed, people often don't realize this and rely on remove making
a copy.

Since implementations don't always perform the optimizations
you need, it often turns out that a hand-written version that
does do what you want will be faster.

-- jeff