;;;; ELT vector vs list x safe vs unsafe. When safe, we must test that 0 <= index < (length seq). Neither NTH nor AREF does the right thing. ;;;; SUBSEQ For lists have a fast and a safe version. For vectors, convert into: (replace (make-array (- end start) :element-type ...) sequence :start2 start :end2 end) ;;;; COPY-SEQ Convert into (subseq seq 0). ;;;; LENGTH Already delt with. ;;;; REVERSE and NREVERSE For lists, just do it. For vectors, have a speed>size transform and pre-compiled functions for: simple-vector (simple-array * (*)) vector ;;;; MAKE-SEQUENCE If the type is constant, try to convert into something else. ;;;; CONCATENATE For list results, iterrate over all the sequences collecting the results. For vector results, convert into a make-array followed by lots of replaces. ;;;; MAP For list results, iterrate collecting the results. For vector results, ;;;; MAP-INTO ;;;; SOME, EVERY, NOTANY, NOTEVERY ;;;; REDUCE ;;;; FILL Vector and list transforms, and handle these cases: ;;;; REPLACE ;;;; REMOVE, REMOVE-IF, REMOVE-IF-NOT ;;;; DELETE, DELETE-IF, DELETE-IF-NOT ;;;; REMOVE-DUPLICATES, DELETE-DUPLICATES ;;;; SUBSTITUTE, SUBSTITUTE-IF, SUBSTITUTE-IF-NOT ;;;; NSUBSTITUTE, NSUBSTITUTE-IF, NSUBSTITUTE-IF-NOT ;;;; FIND, FIND-IF, FIND-IF-NOT ;;;; POSITION, POSITION-IF, POSITION-IF-NOT ;;;; COUNT, COUNT-IF, COUNT-IF-NOT ;;;; MISMATCH ;;;; SEARCH