lua-users home
lua-l archive

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


> On Aug 6, 2016, at 6:26 AM, Soni L. <fakedme@gmail.com> wrote:
> 
> 
> 
> Well, you actually need to use "local function _SELF”

Yes of course .. or “local _SELF; _SELF = …"
> 
> Also:
> 
> do
> local function _SELF() print(_SELF) end
> x = _SELF
> _SELF = nil
> end
> 
> x() --> nil
> 
> While a proper _SELF would be safe from such things.
> 

Safe from getting it’s own declaration wrong?The whole point of the do..end is to make sure that the local _SELF is indeed inaccessible to anything except the function. If the function self-destructs then that’s what I would call a bug.

—Tim