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

re: Updates to near finalization (finally!)

This page is part of the web mail archives of SRFI 43 from before July 7th, 2015. The new archives for SRFI 43 contain all messages, not just those from before July 7th, 2015.

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