I have a term which may or may not contain the atom 'this'. The term may also contain variables. I need to replace 'this' with a variable I. How can I do this? I tried to do something like this:
term_to_atom((f(a), g(this, b), ...), A),
tokenize_atom(A, L),
replace(this, I, L, L2)
It seemed to work. The problem is, I need to go back to the original term and I can't do it...