lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


What is so special about function variables?
I guess the same applies also for all other kind of variables:

function foo()
   bar = {}
   -- do somthing with bar
end
foo()
-- the variable bar stays active in the globals
-- while normally no one cares, it is a possible bug, and at least a waste
of resources.

> And IMHO this is what should be the default.  I can't think of very
> much cases where you really want a nested function statement to create
> a global function.
I guess with the new 4.1 locals, the next logical step would be to make all
variables local by default.

> So, what do you think about this proposal?  Discussion opened :-)
Let's take one step after another, not all at once.
This should be a proposal for Lua 4.2 ;-)

Cheers,
Peter