lua-users home
lua-l archive

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


If I'm understanding your question correctly, you're wondering why __newindex isn't called when assigning variables to keys that already exist.
It does.

If I'm not understanding your question correctly, you're wondering why there is no callback for when keys are accessed.
That's what __index is for.


...or am I just completely wrong?

On 22 April 2011 03:00, HyperHacker <hyperhacker@gmail.com> wrote:
I'm just curious why there exists __newindex for catching assignment
to an empty key, but nothing for non-empty keys. Would it be
prohibitively slow? I know there exists a patch to add it, but I'm
wondering why it's not an official feature.

--
Sent from my toaster.