1:21:21aethThat's because removing from the middle of a vector is messy if you have to keep the order (if order doesn't matter you just move the last element into the removed element's spot)
1:22:57aethIf order didn't matter it would just be (subseq foo 0 (- length-foo (1+ matches))) and then overwrite the matches in the copy with the stuff that didn't get copied
1:24:06aethWith order mattering you'll have to make a new list at the size of (- length-foo (1+ matches)) and then, in a second iteration, copy element-by-element if not a match afaik.
1:25:31no-defun-allowedis vector-push-extend usually O(1)? could use an adjustable vector and guess the size (eg 1/2 the original)
1:26:06Bikeusually it's amortized constant time, i think. assuming nothing weird happens with the allocation anyway
1:27:22no-defun-allowedi would think there'd be a bit of moving to extend, dunno
1:27:38aethWith my approach I guess the second loop would be something like this: (loop :for item :in original :with i := 0 :when (funcall test item) :do (progn (setf (aref new-vector i) item) (incf i)))
1:28:08aethYou'd get the size of the new-vector with count/count-if/count-if-not
1:28:37aethIt would be complicated a bit because the type would have to match and there are a lot of 1D array types
1:29:11aeth(I didn't run that loop, it probably has bugs)