lua-users home
lua-l archive

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


On Wed, Dec 15, 2010 at 08:28, Marc Balmer <marc@msys.ch> wrote:
> Is there a way to detect in an __index meta-method, written in C, if the
> access is for reading or writing a value?  I.e. to distinguish between
>
> a.b.c = 42
>
> and
>
> local answer = a.b.c
>
> ?
>
> - mb
>
>

The first triggers __newindex, if the value isn't already set.

-- 
Sent from my toaster.