September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,39 +0,0 @@
|
|||
CLASS-ID. Animal.
|
||||
*> ...
|
||||
END CLASS Animal.
|
||||
|
||||
CLASS-ID. Dog INHERITS Animal.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Animal.
|
||||
|
||||
*> ...
|
||||
END CLASS Dog.
|
||||
|
||||
CLASS-ID. Cat INHERITS Animal.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Animal.
|
||||
|
||||
*> ...
|
||||
END CLASS Cat.
|
||||
|
||||
CLASS-ID. Lab INHERITS Dog.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Dog.
|
||||
|
||||
*> ...
|
||||
END CLASS Lab.
|
||||
|
||||
CLASS-ID. Collie INHERITS Dog.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
CLASS Dog.
|
||||
|
||||
*> ...
|
||||
END CLASS Collie.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
(defclass animal () ())
|
||||
(defclass dog (animal) ())
|
||||
(defclass lab (dog) ())
|
||||
(defclass collie (dog) ())
|
||||
(defclass cat (animal) ())
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
(defstruct animal)
|
||||
(defstruct (dog (:include animal)))
|
||||
(defstruct (lab (:include dog)))
|
||||
(defstruct (collie (:include dog)))
|
||||
(defstruct (cat (:include animal)))
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
;;; ASN.1 serialization logic specialized for animal class
|
||||
(defmethod serialize-to-asn-1 ((a animal))
|
||||
#| ... |#
|
||||
)
|
||||
|
||||
;;; casually introduce the method over strings too; no relation to animal
|
||||
(defmethod serialize-to-asn-1 ((s string))
|
||||
#| ... #|
|
||||
)
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
TYPE
|
||||
Animal = ABSTRACT RECORD (* *) END;
|
||||
Cat = RECORD (Animal) (* *) END; (* final record (cannot be extended) - by default *)
|
||||
Dog = EXTENSIBLE RECORD (Animal) (* *) END; (* extensible record *)
|
||||
Lab = RECORD (Dog) (* *) END;
|
||||
Collie = RECORD (Dog) (* *) END;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
(defclass animal () ())
|
||||
(defclass dog (animal) ())
|
||||
(defclass lab (dog) ())
|
||||
(defclass collie (dog) ())
|
||||
(defclass cat (animal) ())
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
(defstruct animal)
|
||||
(defstruct (dog (:include animal)))
|
||||
(defstruct (lab (:include dog)))
|
||||
(defstruct (collie (:include dog)))
|
||||
(defstruct (cat (:include animal)))
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
;;; ASN.1 serialization logic specialized for animal class
|
||||
(defmethod serialize-to-asn-1 ((a animal))
|
||||
#| ... |#
|
||||
)
|
||||
|
||||
;;; casually introduce the method over strings too; no relation to animal
|
||||
(defmethod serialize-to-asn-1 ((s string))
|
||||
#| ... #|
|
||||
)
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
TYPE
|
||||
Animal = ABSTRACT RECORD (* *) END;
|
||||
Cat = RECORD (Animal) (* *) END; (* final record (cannot be extended) - by default *)
|
||||
Dog = EXTENSIBLE RECORD (Animal) (* *) END; (* extensible record *)
|
||||
Lab = RECORD (Dog) (* *) END;
|
||||
Collie = RECORD (Dog) (* *) END;
|
||||
|
|
@ -1,26 +1,24 @@
|
|||
#import system.
|
||||
|
||||
#class Animal
|
||||
class Animal
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
#class Dog :: Animal
|
||||
class Dog :: Animal
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
#class Lab :: Dog
|
||||
class Lab :: Dog
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
#class Collie :: Dog
|
||||
class Collie :: Dog
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
#class Cat :: Animal
|
||||
class Cat :: Animal
|
||||
{
|
||||
// ...
|
||||
}.
|
||||
|
|
|
|||
32
Task/Inheritance-Single/Kotlin/inheritance-single.kotlin
Normal file
32
Task/Inheritance-Single/Kotlin/inheritance-single.kotlin
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// version 1.0.6
|
||||
|
||||
open class Animal {
|
||||
override fun toString() = "animal"
|
||||
}
|
||||
|
||||
open class Dog : Animal() {
|
||||
override fun toString() = "dog"
|
||||
}
|
||||
|
||||
class Cat : Animal() {
|
||||
override fun toString() = "cat"
|
||||
}
|
||||
|
||||
class Labrador : Dog() {
|
||||
override fun toString() = "labrador"
|
||||
}
|
||||
|
||||
class Collie : Dog() {
|
||||
override fun toString() = "collie"
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val felix: Animal = Cat()
|
||||
val rover: Animal = Dog()
|
||||
val bella: Dog = Labrador()
|
||||
val casey: Dog = Collie()
|
||||
println("Felix is a $felix")
|
||||
println("Rover is a $rover")
|
||||
println("Bella is a $bella")
|
||||
println("Casey is a $casey")
|
||||
}
|
||||
10
Task/Inheritance-Single/OoRexx/inheritance-single.rexx
Normal file
10
Task/Inheritance-Single/OoRexx/inheritance-single.rexx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
-- subclass of object by default
|
||||
::class animal
|
||||
|
||||
::class cat subclass animal
|
||||
|
||||
::class dog subclass animal
|
||||
|
||||
::class lab subclass dog
|
||||
|
||||
::class collie subclass dog
|
||||
4
Task/Inheritance-Single/Zkl/inheritance-single.zkl
Normal file
4
Task/Inheritance-Single/Zkl/inheritance-single.zkl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class Animal{}
|
||||
class Dog(Animal){} class Cat(Animal){}
|
||||
class Lab(Dog){} class Collie(Dog){}
|
||||
Collie.linearizeParents
|
||||
Loading…
Add table
Add a link
Reference in a new issue