Re: Changes to %fn%(), fn.call() or func('fn') syntax?
Posted: 30 Jan 2021, 19:36
See Experimenting with scope, function and variable references.
> Assignments accidentally overwriting functions.
Like classes, functions create constants, so there is no accidentally overwriting them, but...
> Variables accidentally shadowing functions by the same name.
Could be an issue. #Warn LocalSameAsGlobal can detect it. On the other hand, I prefer to intentionally shadow global variables without requiring a declaration, and that means not using the warning.
> The reduction in load-time error checking.
Calls to valid functions are still validated. #Warn VarUnset detects most typos in function names, including naked references to functions.
> auto-includes
I removed them.
Regarding some potential drawbacks I mentioned in this topic,I wrote:I have uploaded an experimental build exploring some potential interrelated language changes.
> Assignments accidentally overwriting functions.
Like classes, functions create constants, so there is no accidentally overwriting them, but...
> Variables accidentally shadowing functions by the same name.
Could be an issue. #Warn LocalSameAsGlobal can detect it. On the other hand, I prefer to intentionally shadow global variables without requiring a declaration, and that means not using the warning.
> The reduction in load-time error checking.
Calls to valid functions are still validated. #Warn VarUnset detects most typos in function names, including naked references to functions.
> auto-includes
I removed them.