[comp.lang.lisp] Code Walker

ralex@tigger.colorado.edu (Repenning Alexander) (04/29/89)

I'm looking for a code walker to replace read/write references to certain variables by a read/write access functions, e.g. something like:

(foo a b) -> (foo (get-value-function 'a) (get-value-function 'b))
(setf a new-value) ->  (set-value-function 'a new-value) or
                       (setf (set-value-function 'a) new-value)

The code walker should not fall into traps like replacing any occurrence of variables introduced within an nested lexical scope, e.g.

(progn
  (bar a)
  (dolist (a ...)
    (foo a)))

should not end up in:

(progn
  (bar (get-value-function 'a))
  (dolist (a ...)
    (foo (get-value-function 'a)))

Any code or hint sent to ralex@boulder.colorado.edu would be appreciated very much.


    Alex