lua-users home
lua-l archive

Re: Uncommon OOP in Lua: right or wrong?

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


Thanks a lot!
> http://www.lua.org/pil/16.4.html
local self = {
 balance = initialBalance,
 LIM = 10000.00,
}
Why put all these variables into table?
> Nothing wrong with it, using closures is a fine, if expensive, way of doing things.
Expensive for memory and cheaper for speed.
I think, this is cool alternative to 'object:method (args)' stuff.
Anyway, shouldn't it be at http://lua-users.org/wiki/ObjectOrientedProgramming

AltStyle によって変換されたページ (->オリジナル) /