I want to pick an element from the list by position and remove that element from the list.
Something like:
Something like:
(defun pick (index list)
(let ((e))
(setf e (nth index list))
(delete e list :start index :end (1+ index))
e))
(defvar *mylist* '(a b c d e)) => *MYLIST*
(pick 2 *mylist*) => C
*mylist* => (A B D E)
But I really do not like the code for pick. I think there should be a more elegant solution...