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

Re: Awaken, discussion!

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.

OK, if no one will comment anything about the draft, then I shall, and
hope that it may spark up a little discussion.

    I added experimentally a VECTOR-INSERT! and a VECTOR-DELETE!, but I
currently do not like their design.
On the matter of VECTOR-INSERT!, I'm specifically considering something like VECTOR-INSERT-{LEFT,RIGHT}!, though they would be confusing, given the differing meanings of *-INSERT-{LEFT,RIGHT}! of SRFI 44. Also, it would be
rather ambiguous what each one did: would VECTOR-INSERT-LEFT! insert
something on the left of the vector and then rotate stuff right, or vice
    VECTOR-DELETE! I also don't like, partially because it, too, shifts
right, like VECTOR-INSERT!.  A better design might be
VECTOR-DELETE-{LEFT,RIGHT}! (though I'd still like a better name), where
the former would remove a value and shift some of the vector left and the
latter would shift some of the vector right.

    An orthogonal idea might be to be able to {insert,delete} stuff from
one vector into another, like with VECTOR-COPY!, but rotate elements as

    A further orthogonal idea might be to have more general versions of
VECTOR-{INSERT,DELETE}!, letting you write
VECTOR-{INSERT,DELETE}-{LEFT,RIGHT}! trivially, and also any variation

    What are your thoughts about these?