Sanitize is not fool proof (yet) .Sanitize2 seems to work as advertized.



>
> Blindly substituting in  f(x):= (globalx: 'x, otherfun(z):= x, lambda([r],x)
> ...)  are all ways that allow the gensym to "escape" and  gets us back to
> the previous situation.
>
> The "right" solution is to recognize free and bound instances of x in the
> function body. 
>
> RJF
Am I right that gensym substitution for x can be done safely if x does
not appear in a non evaluated
argument to some function?

The following seems safe

f(x):=(define(otherfun(z),x))

since define evaluates its second argument.

Michel