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
33
Task/Inheritance-Single/Comal/inheritance-single-1.comal
Normal file
33
Task/Inheritance-Single/Comal/inheritance-single-1.comal
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
STRUC Animal
|
||||
DIM Species$ OF 20
|
||||
ENDSTRUC Animal
|
||||
|
||||
STRUC Dog
|
||||
INHERIT Animal
|
||||
DIM Race$ OF 20
|
||||
FUNC New CONSTRUCTOR
|
||||
Species$="Dog"
|
||||
ENDFUNC New
|
||||
ENDSTRUC Dog
|
||||
|
||||
STRUC Cat
|
||||
INHERIT Animal
|
||||
DIM Race$ OF 20
|
||||
FUNC New CONSTRUCTOR
|
||||
Species$="Cat"
|
||||
ENDFUNC New
|
||||
ENDSTRUC Cat
|
||||
|
||||
STRUC Lab
|
||||
INHERIT Dog
|
||||
FUNC New CONSTRUCTOR
|
||||
Race$:="Lab"
|
||||
ENDFUNC New
|
||||
ENDSTRUC Lab
|
||||
|
||||
STRUC Collie
|
||||
INHERIT Dog
|
||||
FUNC New CONSTRUCTOR
|
||||
Race$:="Collie"
|
||||
ENDFUNC New
|
||||
ENDSTRUC Collie
|
||||
5
Task/Inheritance-Single/Comal/inheritance-single-2.comal
Normal file
5
Task/Inheritance-Single/Comal/inheritance-single-2.comal
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(defclass animal () ())
|
||||
(defclass dog (animal) ())
|
||||
(defclass lab (dog) ())
|
||||
(defclass collie (dog) ())
|
||||
(defclass cat (animal) ())
|
||||
5
Task/Inheritance-Single/Comal/inheritance-single-3.comal
Normal file
5
Task/Inheritance-Single/Comal/inheritance-single-3.comal
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(defstruct animal)
|
||||
(defstruct (dog (:include animal)))
|
||||
(defstruct (lab (:include dog)))
|
||||
(defstruct (collie (:include dog)))
|
||||
(defstruct (cat (:include animal)))
|
||||
9
Task/Inheritance-Single/Comal/inheritance-single-4.comal
Normal file
9
Task/Inheritance-Single/Comal/inheritance-single-4.comal
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
;;; 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))
|
||||
#| ... #|
|
||||
)
|
||||
6
Task/Inheritance-Single/Comal/inheritance-single-5.comal
Normal file
6
Task/Inheritance-Single/Comal/inheritance-single-5.comal
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue