Multiple inheritance allows to specify that one  class is a subclass of several other classes.

Some languages allow multiple inheritance for arbitrary classes,   others restrict it to interfaces,   some don't allow it at all.



Task

Write two classes (or interfaces) Camera and MobilePhone,   then write a class CameraPhone which is both a Camera and a MobilePhone.

There is no need to implement any functions for those classes.




function setmetatables(t,mts) --takes a table and a list of metatables
  return setmetatable(t,{__index = function(self, k)
    --collisions are resolved in this implementation by simply taking the first one that comes along.
    for i, mt in ipairs(mts) do
      local member = mt[k]
      if member then return member end
    end
  end})
end
 
camera = {}
mobilephone = {}
cameraphone = setemetatables({},{camera,mobilephone})