lua-users home
lua-l archive

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


> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br 
> [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of 
> Dimitris Papavasiliou
> Sent: Wednesday, October 13, 2004 11:50 AM
> To: Lua list
> Subject: Re: Userdata with methods *and* table access.

> So in your case, you should first set the methods (move, 
> setpos etc.) before the __index and __newindex metamethods 
> have been installed so that the metamethods will be bypassed 
> for move or setpos (where the table values will be the 
> functions and not nil) but not for x, y (whose values will be nil).

 You seem to suggest that the order which you register functions in the
userdata's metatable matters.  From my quick test adding the "__index"
metamethod last it does not seem to be the case.

  Tom Spilman
  Co-owner | Programmer
  www.sickheadgames.com