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

RE: remove and <array>



> Am I misreading the reference manual, or are remove and remove-key really
> not available on <vector>?

There's a default method on remove for all sequences that just copies;
that much is documented. The intent was for remove! to behave like 
remove unless otherwise specified, although I couldn't find that 
explicitly stated after a quick search.

The remove-key! method is part of the protocol of mutable explicit 
key collections, and so doesn't apply to <vector>. Maybe I can see 
where you're coming from, but even if remove-key! weren't required
to work destructively, doing remove-key! on a vector index would 
still leave the key present (albeit with a different value) for every 
case but the last index. Which is an odd contract!

Functional Developer's Dylan library behaves as I've described I 
think.

-- Keith



Follow-Ups: References: