Since
static nested functions were introduced in v2.0-bata6 and will never become
closure as a complementary to closures,
non-static nested functions should immediately become
closure instead, first time and every time the outer function runs. There is no possibility and no reason whatsoever for
non-static nested functions to duplicately do what
static nested functions have already achieved and been specifically responsible for. It should always be closure as a clear and reasonable division of labor.
As it has been substantially "marked" as
closure at the first time you write
f(){, by whether it has
static keyword fronted. It's time to make a change to give
static nested functions which should have become a closure from the very beginning, a support to directly use
%var% for outer variable's accessing and assignment, without any manually capturing.
It should be like this:
Code: Select all
f(){
cc:='321'
ff(){
d:='cc'
OutputDebug(%d%)
%d%:=55
}
OutputDebug(cc)
}
f()
After getting rid of making complex internal rules and taking time to determine whether and when an inner function should become a closure, all the script program has to do is to check at the load time if the keyword
static is not given. Obviously, it simplifies the internal rules for computers, but more importantly, it gives convenience to use
%var% directly in a de facto closure for us.