June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
24
Task/Polymorphic-copy/Elena/polymorphic-copy.elena
Normal file
24
Task/Polymorphic-copy/Elena/polymorphic-copy.elena
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import extensions.
|
||||
|
||||
class T
|
||||
{
|
||||
Name = "T".
|
||||
|
||||
clone = T new.
|
||||
}
|
||||
|
||||
class S :: T
|
||||
{
|
||||
Name = "S".
|
||||
|
||||
clone = S new.
|
||||
}
|
||||
|
||||
program =
|
||||
[
|
||||
type<T> original := S new.
|
||||
type<T> clone := original clone.
|
||||
|
||||
console printLine(original Name).
|
||||
console printLine(clone Name).
|
||||
].
|
||||
Loading…
Add table
Add a link
Reference in a new issue