Sanitize is not fool proof (yet) .Sanitize2 seems to work as advertized.
Subject: Sanitize is not fool proof (yet) .Sanitize2 seems to work as advertized.
From: Michel Van den Bergh
Date: Tue, 02 Jan 2007 17:56:11 +0100
Stavros Macrakis wrote:
> On 1/2/07, Michel Van den Bergh <michel.vandenbergh at uhasselt.be> wrote:
>> To avoid confusion I would like to stress again that the issue with my
>> example is not related to quotation.
>
> I understand. I was replying to a post suggesting f('x):=.
>
>> Something like Richard's sanitize (suitably extended) which would
>> replace parameters
>> and local block variables (and probably the dummy variables in lambda
>> expression as well) by ?gensym()'s
>> would go a long way to emulating lexical scope I think.
>
> Off the top of my head, there are three issues with "sanitize":
>
> -- how to make it efficient
Hmm you run it only once per function so this is not so important.
> -- how to make functions display reasonably
It would be like compile(-). Just keep the original definition of the
function around for display.
But I consider this less urgent. After all the user already has the
definition of his function
in his source files.
> -- handling quoted material which happens to contain symbols with
> the same name as variables (e.g. f(x):= 'x )
This is tricky. I would guess that quoted material should not be touched
since f(x):='x seems to be
equivalent to f(y):='x. This also goes for things like f(x):='(x+1).
Michel