Inheritance with Lua

Now we can discuss how to implement inheritance using Lua's tables. Let's start with a sample class with the information from the previous post:
Foo = {}
Foo_mt = { __index = Foo }
function Foo.create()
  local instance = {}
  setmetatable( instance , Foo_mt )
  return instance
end
function Foo.Work()
  print("hi")
end
With this setup, you can create … Continue Reading ››