September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,26 +1,24 @@
|
|||
#import system.
|
||||
|
||||
#symbol CameraFeature =
|
||||
class CameraFeature =
|
||||
{
|
||||
#method cameraMsg
|
||||
cameraMsg
|
||||
= "camera".
|
||||
}.
|
||||
|
||||
#class MobilePhone
|
||||
class MobilePhone
|
||||
{
|
||||
#method mobileMsg
|
||||
mobileMsg
|
||||
= "phone".
|
||||
}
|
||||
|
||||
#class CameraPhone :: MobilePhone
|
||||
class CameraPhone :: MobilePhone
|
||||
{
|
||||
#method => CameraFeature.
|
||||
dispatch => CameraFeature.
|
||||
}
|
||||
|
||||
#symbol program =
|
||||
program =
|
||||
[
|
||||
#var cp := CameraPhone new.
|
||||
var cp := CameraPhone new.
|
||||
|
||||
console writeLine:(cp cameraMsg).
|
||||
console writeLine:(cp mobileMsg).
|
||||
console writeLine(cp cameraMsg).
|
||||
console writeLine(cp mobileMsg).
|
||||
].
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
#import system.
|
||||
#import system'dynamic.
|
||||
import system'dynamic.
|
||||
|
||||
#class CameraFeature
|
||||
class CameraFeature
|
||||
{
|
||||
#method cameraMsg
|
||||
cameraMsg
|
||||
= "camera".
|
||||
}
|
||||
|
||||
#class MobilePhone
|
||||
class MobilePhone
|
||||
{
|
||||
#method mobileMsg
|
||||
mobileMsg
|
||||
= "phone".
|
||||
}
|
||||
|
||||
#symbol CameraPhone =
|
||||
class CameraPhone =
|
||||
{
|
||||
new = MobilePhone new mix &into:(CameraFeature new).
|
||||
new = MobilePhone new; mixInto(CameraFeature new).
|
||||
}.
|
||||
|
||||
#symbol program =
|
||||
program =
|
||||
[
|
||||
#var cp := CameraPhone new.
|
||||
var cp := CameraPhone new.
|
||||
|
||||
console writeLine:(cp cameraMsg).
|
||||
console writeLine:(cp mobileMsg).
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
include FMS-MIBuildGen.f
|
||||
include FMS-MIHarnGen.f
|
||||
include FMS-MI.f
|
||||
|
||||
:class Camera
|
||||
;class
|
||||
|
||||
:class MobilePhone
|
||||
;class
|
||||
|
||||
:class CameraPhone super{ Camera MobilePhone } \ any number of superclasses may be used
|
||||
;class
|
||||
|
||||
CameraPhone cf \ instantiate a CameraPhone object named cf
|
||||
14
Task/Inheritance-Multiple/OoRexx/inheritance-multiple.rexx
Normal file
14
Task/Inheritance-Multiple/OoRexx/inheritance-multiple.rexx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
-- inherited classes must be created as mixinclasses.
|
||||
::class phone mixinclass object
|
||||
|
||||
::class camera mixinclass object
|
||||
|
||||
-- not a direct subclass of either, but inherits both
|
||||
::class cameraphone inherit phone camera
|
||||
|
||||
-- could also be
|
||||
::class cameraphone1 subclass phone inherit camera
|
||||
|
||||
-- or
|
||||
|
||||
::class cameraphone2 subclass camera inherit phone
|
||||
3
Task/Inheritance-Multiple/Zkl/inheritance-multiple.zkl
Normal file
3
Task/Inheritance-Multiple/Zkl/inheritance-multiple.zkl
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class Camera{} class MobilePhone{}
|
||||
class CameraPhone(Camera,MobilePhone){}
|
||||
CameraPhone.linearizeParents
|
||||
Loading…
Add table
Add a link
Reference in a new issue