I'm trying to "upgrade" some methods from supporting list to supporting generic sequence.
However, I couldn't figure out how to change the value of a sequence destructively.
E.g., if I want to insert a element into a list, I can do something like
(setf (nthcdr n seq) (cons element (nthcdr n seq)))
to insert element into the nth position in seq
But with sequences, I don't see any generic functions that can do similar work.
Am I missing something?
BTW, what I'm doing now is define my own generic function, like
(cl-defgeneric my-insert-at (elt seq)))
The idea is I'll implement this function for the generic sequence
that I'll define in the future. Is that a correct approach?
Other destructive functions that I couldn't find alternatives are delete, push, pop, etc.