[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: _SELF and _SUPER
- From: Tim Hill <drtimhill@...>
- Date: Sun, 7 Aug 2016 01:31:44 -0700
> On Aug 6, 2016, at 6:26 AM, Soni L. <email@example.com> wrote:
> Well, you actually need to use "local function _SELF”
Yes of course .. or “local _SELF; _SELF = …"
> local function _SELF() print(_SELF) end
> x = _SELF
> _SELF = nil
> 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.