First of all, I work with LispWorks. I have an adjustable array where I want to insert an element in position i < fill-pointer, so I will need to move all the elements from i to its position + 1. My problem is I don't know how to do that and have as result an adjustable array but WITHOUT COPYING all the elements to another array. Performance is really important. With this array #(0 1 2 3 4 6 7) my way to insert number 5 in position i=5:
(let ((arr (make-array 7 :initial-contents (list 0 1 2 3 4 6 7)
:adjustable T :fill-pointer 7))
(i 5))
(concatenate 'vector (subseq arr 0 i)
(make-array 1 :initial-contents '(5))
(subseq arr i (fill-pointer arr))))
which I don't know if LispWorks is internally copying all elements to the result array, but gives me the desired array, although it is no adjustable and does not have fill-pointer. Some idea?