Email list hosting service & mailing list manager


re: Updates to near finalization (finally!) Matthew Dempsky 20 Feb 2004 01:27 UTC

> There is a solitary remaining issue: should VECTOR-REVERSE-COPY! be
> defined if TARGET & SOURCE are the same -- in terms of EQ? --? and if
> so, what shuuld its semantics be?

C++'s Standard Library has a routine reverse_copy which has a
precondition of the output range and input range being
non-overlapping.  (The preconditions in the Std. Lib are needed to be
enforced by the client, not the library.)

I think the simplest solution is to leave the result undefined if the
ranges overlap (not necessarily error), however, it might be more
reliable to add a requirement that when there's aliasing, the
destination range should be correctly filled in whatever order so that
at the function's termination it holds the same values (in opposite
order) that the source range held before.

(An extra EQ? test should be dwarfed by the cost of iterating the
vector anyways, I'd expect.)

-jivera