Inheritance/Multiple: Difference between revisions

Content added Content deleted
No edit summary
Line 834: Line 834:
mobilephone = {}
mobilephone = {}
cameraphone = setemetatables({},{camera,mobilephone})</lang>
cameraphone = setemetatables({},{camera,mobilephone})</lang>

=={{header|M2000 Interpreter}}==
<lang M2000 Interpreter>
Module CheckIt {
Class Camera {
IamCamera
}
Class MobilePhone {
IamMobilePhone
}
Class CameraPhone {
Module CameraPhone {
\\ we can use : This=Camera() : This=MobilePhone()
\\ but we have to use Final for Functions/Modules in This
\\ So using M, a new local variable, we can accumulate Inheritance
M=Camera()
M=MobilePhone()
M=This
This=M
}
}
CP1=CameraPhone()
Print Valid(CP1.IamCamera)=True, Valid(CP1.IamMobilePhone)=true
}
CheckIt
</lang>


=={{header|Nemerle}}==
=={{header|Nemerle}}==