lua-users home
lua-l archive

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


In fact the problem here was that the metatable was being (unexpectedly)
replaced by other code elsewhere in the app, lacking a _newindex, hence the
global was being set.  So it was my (silly) problem.

Sorry to waste your time on this one!

Love, Light and Peace,
- Peter Loveday
Director of Development, eyeon Software


----- Original Message -----
From: "Peter Shook" <pshook@tropicnetworks.com>
To: "Multiple recipients of list" <lua-l@tecgraf.puc-rio.br>
Sent: Friday, October 04, 2002 5:43 PM
Subject: Re: index/newindex on a table


> >>Try starting from the simplest example and build up. This is what I get:
> >
> >You output seems to be what I expected. What is wrong wiht it?
> >The __index metamethod is called twice and the __newindex once.
> >Since the __newindex metamethod does not set the value of XYZ,
> >the __index metamethod is called a second time. Isn't that right?
> >--lhf
>
> Yes, I (Peter Shook) would say so.  :-)
>
> I was trying to give a simple working example for Peter Loveday to compare
with his code.  He never provided his code, so it is hard to say what's
wrong.  I think his __newindex event handler must somehow be setting XYZ in
the globals table.
>
> Cheers,
>
> - Peter Shook
>