[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: How metatables could work on this?
- From: Francisco <xxleite@...>
- Date: Tue, 1 May 2012 13:49:27 -0300
Hi list,
How can a make this work? ...
local demoControl = {
execute = function( self )
self.model():show()
end
}
local demoView = {
show = function( self )
print('something something pseudo class proxy whateva!')
end
}
local loader = {}
loader = setmetatable( {
internal = "internal value",
control = function( self )
local n = setmetatable( demoControl, { __index=self } )
n:execute()
end,
model = function( self )
print( self.internal )
return setmetatable( demoView, { __index=self } )
end
},{ __index = loader } )
any = loader
any:control()
--
xxleite@gmail.com
cel.: (11) 7531.7438
site: about.leite.us