lua-users home
lua-l archive

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


Hi,

This release of the class library is backwards compatible with the previous ones and adds the possibility of defining __get() and __set() methods to get control of indexing.

This is useful for defining classes that may work like arrays or tables but do not store their elements in the main body of the object. Then __get() and __set() are called each time elements are read or assigned. One interesting application is proxy classes giving access to remote data.

This feature is based on __index() and __newindex() handlers and therefore has some cost in terms of performance, but these handlers are only installed in classes that use __get() and __set(). Other classes are unaffected.

http://lua-users.org/wiki/MultipleInheritanceClasses
http://luaforge.net/projects/luamiclasses/

Best regards,
Hugo