lua-users home
lua-l archive

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


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