[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Detecting read or write access in __index metamethod
- From: HyperHacker <hyperhacker@...>
- Date: Wed, 15 Dec 2010 08:30:31 -0700
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.