I just checked in a major re-write of the underlying code for
vectors, strings, and uniform vectors.
The basic idea is to efficiently support vector-indexes, as in APL:
#|kawa:1|# (! vec1 (vector 'A 'B 'C 'D 'E 'F))
#|kawa:2|# (vec1 [3 5 2])
#(D F C)
The range [2 <: 6] is (roughly) the same as [2 3 4 5]:
#|kawa:3|# (vec1 [2 <: 6])
#(C D E F)
(Th '<:' is a keyword; the '<' is a mnemonic for the
the set of integers '<' the end value 6. You can also use <=:.)
A range is different from a vector integer in that you can use
a range as the index in the LHS of a set!:
#|kawa:4|# (set! (vec1 [2 <: 4]) #(a b c d e))
#(A B a b c d e E F)
Notice how the number of replaced elements can be different
then the(! str1 number of elements in the replacement value.
I.e. you can do insertion and deletion this way.
The vector automatically converts to a "gap vector".
The internal data structures have changed a lot but I won't go into details here.
It's worth mentining that the changes enable better type inference, and better
support of vectors of primitive types (uniform vectors) without object allocation.
These changes aren't as polished and optimized as I would like, but I needed to check
them in so I can focus on something else (for the JVM languages summit, where
I'll be giving a workshop).