Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,13 +0,0 @@
|
|||
package Inheritance is
|
||||
type Animal is tagged private;
|
||||
type Dog is new Animal with private;
|
||||
type Cat is new Animal with private;
|
||||
type Lab is new Dog with private;
|
||||
type Collie is new Dog with private;
|
||||
private
|
||||
type Animal is tagged null record;
|
||||
type Dog is new Animal with null record;
|
||||
type Cat is new Animal with null record;
|
||||
type Lab is new Dog with null record;
|
||||
type Collie is new Dog with null record;
|
||||
end Inheritance;
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
CLASS-ID. Animal.
|
||||
*> ...
|
||||
END CLASS Animal.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
CLASS-ID. Dog
|
||||
INHERITS FROM Animal.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Animal.
|
||||
|
||||
*> ...
|
||||
END CLASS Dog.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
CLASS-ID. Cat
|
||||
INHERITS FROM Animal.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Animal.
|
||||
|
||||
*> ...
|
||||
END CLASS Cat.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
CLASS-ID. Lab
|
||||
INHERITS FROM Dog.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Dog.
|
||||
|
||||
*> ...
|
||||
END CLASS Lab.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
CLASS-ID. Collie
|
||||
INHERITS FROM Dog.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Dog.
|
||||
|
||||
*> ...
|
||||
END CLASS Collie.
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
class Animal {
|
||||
// ...
|
||||
}
|
||||
class Cat extends Animal {
|
||||
// ...
|
||||
}
|
||||
class Dog extends Animal {
|
||||
// ...
|
||||
}
|
||||
class Lab extends Dog {
|
||||
// ...
|
||||
}
|
||||
class Collie extends Dog {
|
||||
// ...
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
class Animal ()
|
||||
end
|
||||
|
||||
class Dog : Animal ()
|
||||
end
|
||||
|
||||
class Cat : Animal ()
|
||||
end
|
||||
|
||||
class Lab : Dog ()
|
||||
end
|
||||
|
||||
class Collie : Dog ()
|
||||
end
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
class Animal {}
|
||||
class Dog : Animal {}
|
||||
class Cat: Animal {}
|
||||
class Lab : Dog {}
|
||||
class Collie : Dog {}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
REBOL [
|
||||
Title: "Inheritance"
|
||||
URL: http://rosettacode.org/wiki/Inheritance
|
||||
]
|
||||
|
||||
; REBOL provides subclassing through its prototype mechanism:
|
||||
|
||||
Animal: make object! [
|
||||
legs: 4
|
||||
]
|
||||
|
||||
Dog: make Animal [
|
||||
says: "Woof!"
|
||||
]
|
||||
Cat: make Animal [
|
||||
says: "Meow..."
|
||||
]
|
||||
|
||||
Lab: make Dog []
|
||||
Collie: make Dog []
|
||||
|
||||
; Demonstrate inherited properties:
|
||||
|
||||
print ["Cat has" Cat/legs "legs."]
|
||||
|
||||
print ["Lab says:" Lab/says]
|
||||
Loading…
Add table
Add a link
Reference in a new issue