Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
22
Task/Polymorphic-copy/Sidef/polymorphic-copy.sidef
Normal file
22
Task/Polymorphic-copy/Sidef/polymorphic-copy.sidef
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
class T(value) {
|
||||
method display {
|
||||
say value;
|
||||
}
|
||||
}
|
||||
|
||||
class S(value) < T {
|
||||
method display {
|
||||
say value;
|
||||
}
|
||||
}
|
||||
|
||||
var obj1 = T("T");
|
||||
var obj2 = S("S");
|
||||
var obj3 = obj2.dclone; # make a deep clone of obj2
|
||||
|
||||
obj1.value = "foo"; # change the value of obj1
|
||||
obj2.value = "bar"; # change the value of obj2
|
||||
|
||||
obj1.display; # prints "foo"
|
||||
obj2.display; # prints "bar"
|
||||
obj3.display; # prints "S"
|
||||
Loading…
Add table
Add a link
Reference in a new issue