lua-users home
lua-l archive

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



On Jul 22, 2009, at 9:14 PM, Wesley Smith wrote:

After reading module v. dofile discussion I was curious how people
handle OO constructs as Lua modules.

A while back, this is what I used:

local LUObject = require( "LUObject" )
local super = LUObject
local self = super()

For example, a List object:

http://dev.alt.textdrive.com/browser/lu/LUList.lua

Some usage examples:

http://dev.alt.textdrive.com/browser/lu/Example.lua

Root object:

http://dev.alt.textdrive.com/browser/lu/LUObject.lua

But, after reflexion, I moved away from OO in Lua. Not worth the bother :))

Cheers,

PA.