I think the best guess is to define your own set-nth, and put it into init.lsp.
Automatically replacing (set-nth n L) with (setf (L n)) will work in simple cases but it is hard to write program that can resolve all (*) generated cases
Code: Select all
(eval (append '(set-nth) expr1 expr2))
((if condition set-nth list) expr1 expr2)
and it cannot work if (**) name of the function itself is generated
Code: Select all
(set x (sym (append "set" "-" "nth"))
Defining your own set-nth can solve all these problems, but still I can think about problems (***) with code that tries to go "behind" name like
Code: Select all
(primitive? set-nth)
(reverse (string set-nth))
However, there are few of these, I believe.
For write-line, I think good guess is to write your own function write9-line which does the same as write-line in v9, put it into init.lsp or on the beginning of each old file, and search & replace write-line with write9-line. On that way, you'll solve simple occurences of write-line and problems of the kind (*), but not (**) and (***) and I believe there are few of these.
In both set-nth, you have identifiers to remind you in the case some problems are left.