[Loop-users] Using the Scoped Model with Table-Access Metamethods

Kurt Nordstrom kurt at blar.net
Thu May 14 01:25:58 GMT+2 2009

Whew, fun topic for my first question for the mailing list, right?

So, here is the situation.  I'm working (well, more like poking at) on 
an idea for a mud-type game with user-creatable/programmable objects 
implemented in Lua.

In order to give a degree of security, using the Scoped Model of LOOP 
classes would be nice, because it would allow game objects to be able to 
be able to interact with each other, yet still maintain private data.

To take security a step further, I'd like to implement custom versions 
of both the __index and the __newindex metamethods on game objects to 
limit who could see and change certain fields.  However, my 
understanding is that LOOP uses these metamethods to handle inheritance 
and member access.

So...my question is...is there a way to implement custom table-access 
meta-methods on top of the LOOP scoped model without breaking things?


More information about the Loop-users mailing list