2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
26
Task/Inheritance-Multiple/Elena/inheritance-multiple-1.elena
Normal file
26
Task/Inheritance-Multiple/Elena/inheritance-multiple-1.elena
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#import system.
|
||||
|
||||
#symbol CameraFeature =
|
||||
{
|
||||
#method cameraMsg
|
||||
= "camera".
|
||||
}.
|
||||
|
||||
#class MobilePhone
|
||||
{
|
||||
#method mobileMsg
|
||||
= "phone".
|
||||
}
|
||||
|
||||
#class CameraPhone :: MobilePhone
|
||||
{
|
||||
#method => CameraFeature.
|
||||
}
|
||||
|
||||
#symbol program =
|
||||
[
|
||||
#var cp := CameraPhone new.
|
||||
|
||||
console writeLine:(cp cameraMsg).
|
||||
console writeLine:(cp mobileMsg).
|
||||
].
|
||||
27
Task/Inheritance-Multiple/Elena/inheritance-multiple-2.elena
Normal file
27
Task/Inheritance-Multiple/Elena/inheritance-multiple-2.elena
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#import system.
|
||||
#import system'dynamic.
|
||||
|
||||
#class CameraFeature
|
||||
{
|
||||
#method cameraMsg
|
||||
= "camera".
|
||||
}
|
||||
|
||||
#class MobilePhone
|
||||
{
|
||||
#method mobileMsg
|
||||
= "phone".
|
||||
}
|
||||
|
||||
#symbol CameraPhone =
|
||||
{
|
||||
new = MobilePhone new mix &into:(CameraFeature new).
|
||||
}.
|
||||
|
||||
#symbol program =
|
||||
[
|
||||
#var cp := CameraPhone new.
|
||||
|
||||
console writeLine:(cp cameraMsg).
|
||||
console writeLine:(cp mobileMsg).
|
||||
].
|
||||
Loading…
Add table
Add a link
Reference in a new issue