lua-users home
lua-l archive

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

2011/5/5 陶陶 <>:
> 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., 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.