Quote Originally Posted by jdarling
If you write an __newindex handler (writer) that uses RTTI to look at the parent class and write a specialized __index handler (reader) then you can emulate properties quite well. I have this working some place, but the method callers arn't complete yet. Actually the code above gives me some ideas so I may be posting up my code for LUA some time soon too
I was thinking about '__index' as well, but as far as I can figure this would only help with making readable properties, not writable ones

How would using '__newindex' help with emulating properties? This is only called if one is adding a new key + value to a table, not for pre-existing keys...

I would be interested in how you got the '__newindex' working for this sort of thing

Also I have no clue as to if it is even possible to protect the existing 'class methods' created in the table from being accidently overwritten by a lua script using the table and assigning a value to that key...

Any thoughts on that one?

cheers,
Paul.