🕸📝Fergus Duniho wrote on Fri, Jul 24, 2020 02:31 AM UTC:
I changed subroutines to copy arguments as my variables instead of local variables. This removes the ability of child subroutines to see the arguments passed to parent subroutines. I made this change for the following reasons:
my scope variables are accessed more quickly than local scope variables.
I never made use of the ability that treating arguments as local variables conferred.
This ability would be useless in recursive subroutines, since a recursively called subroutine will have the same parameters as its parent subroutine.
Using this ability makes code harder to follow. It is usually keeps things clearer when you pass as arguments the specific values that a subroutine needs.
[Edit: While three of the reasons still apply, it turns out that I did previously make use of the ability of child functions to see arguments passed to parent subroutines. This broke some code, and I switched it back to how it was.]
I changed subroutines to copy arguments as my variables instead of local variables. This removes the ability of child subroutines to see the arguments passed to parent subroutines. I made this change for the following reasons:I never made use of the ability that treating arguments as local variables conferred.[Edit: While three of the reasons still apply, it turns out that I did previously make use of the ability of child functions to see arguments passed to parent subroutines. This broke some code, and I switched it back to how it was.]