lua-users home
lua-l archive

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

--- In, Luiz Henrique de Figueiredo <lhf@t...>
> >According to the manual the __newindex metamethod is
> >the settable event.I tried setting the same var twice(i=2;i=3;) and my
> >metamethod got called twice.
> That's because your __newindex function didn't set the value of "i"
the first
> time. This may be or not what you want.

Hmmmm, definately not.Why are there so few metamethods?One for reading
a table value(anytime) and for the assignment operator would
definately come in handy.Are there design restrictions that don't
allow this?So now I'll have to work around writing C vars(more than
once) and mixing C and lua globals.And everything was so simple in lua4...