标签:lua
function people( name)
local self = {}
local function init( ... )
self.name=name
end
self.sayHi=function ( ... )
print("hello"..self.name)
end
init()
return self
end
function Man( name)
self=people(name)
self.sayHello=function ( )
print("hi"..self.name)
end
return self
end
local ex = Man("李四")
ex.sayHello()
标签:lua
原文地址:http://blog.csdn.net/richard_rufeng/article/details/45672339