So I have an expression and I want to replace all occurrences of the function list by my-list, as follows.
- Code: Select all
(defparameter *expr* '(let ((list (quote (1 2 3)))) ;; comment list
(append list (list 4 5 'list "list, 'list, LIST"))))
=>(LET ((LIST '(1 2 3)))
(APPEND LIST (MY-LIST 4 5 'LIST "list, 'list, LIST")))
It seems that using the subst or subst-if function is a good idea,
but how do I check if the symbol list is used as a function in the expression?