On the dangers of automated refactoring

Alex Tweedly alex at tweedly.net
Wed Apr 14 15:38:59 EDT 2021


On 14/04/2021 10:23, Andre Garzia via use-livecode wrote:
> That is the main issue, the code was using the wrong hungarian-lite prefixes. You’d see something like
>
>    on myHandler pDataA
>>    end myHandler
>
>
> But, lo and behold, on top of the script there would be something like
>
>    local pDataA
>
> Now, is that an argument to a handler? a script-local? It depends! Strict compilation mode doesn’t care about variable shadowing.

Never mind strict compilation mode, I think this should be a "compile" 
error anyway.

With or without strict-compilation :

   variable shadowing with a script-local and a handler-local is an error.

   variable shadowing with a parameter and a handler-local is an error.

why on earth is variable shadowing between a script-local and a 
parameter not also an error.

Alex.





More information about the use-livecode mailing list