RosettaCodeData/Task/Inheritance-Multiple/Lingo/inheritance-multiple-3.lingo

16 lines
331 B
Plaintext

-- parent script "CameraPhone"
property ancestor
on new (me)
c = script("Camera").new()
mp = script("MobilePhone").new()
-- make the Camera instance a parent of the MobilePhone instance
mp.setProp(#ancestor, c)
-- make the MobilePhone instance a parent of this CameraPhone instance
me.ancestor = mp
return me
end