savage
savage copied to clipboard
Variable substitution should be performed only once, not on each evaluation step
The current implementation can cause infinite loops and infinite recursion, for example with this input:
f(x) = x
f(x)
The problem here is that the substituted expression is itself a variable with the same identifier as the variable it is substituted for, so substitution continues forever.