If you are happy to destructively modify the list, then you can use
setf. For example, the following would set the 39th element to be 97:
Code:
(setf (nth 39 mylist) 97)
A more functional (non-destructive) approach could copy the list recursively, ie:
Code:
(defun nreplace (n l e)
(cond
((= n 0) (cons e (cdr l)))
(t (cons (car l) (nreplace (- n 1) (cdr l) e)))))
(nreplace 39 mylist 97)
But these are both inefficient; if you need to do this sort of thing often, perhaps you would look at using an array instead of a list.