On the dangers of automated refactoring

Alex Tweedly alex at tweedly.net
Wed Apr 14 18:13:00 EDT 2021


On 14/04/2021 21:01, Ralph DiMola via use-livecode wrote:
> Good question... I'm thinking it's the same reason that with strict compilation enabled a variable in a repeat loop does not have to be declared as a script local. If it is declared as a script local no shadow error occurs. A handler parameter in a way is the same as it doesn't need parameters to be declared.
>
> What is the scope of the variable vs. the handler parameter when the handler is running? That's bigger question.

The parameter is different from the script-local variable (i.e. changing 
it within the handler changes the parameter, not the script-local).

(and, btw, the same non-reporting happens if it's a global shadowed by a 
parameter name).

Alex.







More information about the use-livecode mailing list