lua-users home
lua-l archive

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


2011/5/5 陶陶 <taozuhong@qq.com>:
> I have found a new OO style,  it is very convenient, so share it for u, any
> suggestion is welcome.
   This style of OOP is usually called "Prototype"-based programming
(see e.g. http://c2.com/cgi/wiki?PrototypeBasedProgramming), or
described as using prototypes rather than classes. You'll probably
find more info looking under that name. It's actually a pretty common
style in Lua. (I like it, too.)

   Also, instead of Client:Print(...), you can use the __tostring
metatable hook.

Scott