Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,3 @@
public class Drums{
//functions go here...
}

View file

@ -0,0 +1,3 @@
public class LatinKit extends Drums{
//functions go here...
}

View file

@ -0,0 +1,3 @@
public class ElectronicKit extends Drums{
//functions go here...
}

View file

@ -0,0 +1,3 @@
public class Congas extends LatinKit{
//functions go here...
}

View file

@ -0,0 +1,3 @@
public class TechnoDrums extends ElectronicKit{
//functions go here...
}

View file

@ -0,0 +1,5 @@
class Animal
class Cat extends Animal
class Dog extends Animal
class Lab extends Dog
class Collie extends Dog

View file

@ -0,0 +1,28 @@
class Animal
(@name) ->
move: (meters) ->
alert @name + " moved #{meters}m."
class Snake extends Animal
-> super ...
move: ->
alert 'Slithering...'
super 5
class Horse extends Animal
-> super ...
move: ->
alert 'Galloping...'
super 45
sam = new Snake 'Sammy the Python'
tom = new Horse 'Tommy the Palomino'
sam.move!
tom.move!

View 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

View file

@ -0,0 +1,5 @@
(defclass animal () ())
(defclass dog (animal) ())
(defclass lab (dog) ())
(defclass collie (dog) ())
(defclass cat (animal) ())

View file

@ -0,0 +1,5 @@
(defstruct animal)
(defstruct (dog (:include animal)))
(defstruct (lab (:include dog)))
(defstruct (collie (:include dog)))
(defstruct (cat (:include animal)))

View 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))
#| ... #|
)

View 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;

View file

@ -0,0 +1,21 @@
' FB 1.05.0 Win64
Type Animal Extends Object ' to enable virtual methods etc. if needed
' ...
End Type
Type Dog Extends Animal
' ...
End Type
Type Cat Extends Animal
' ...
End Type
Type Lab Extends Dog
' ...
End Type
Type Collie Extends Dog
' ...
End Type

View file

@ -0,0 +1,24 @@
define animal => type {
data public gender::string
}
define dog => type {
parent animal
}
define cat => type {
parent animal
}
define collie => type {
parent dog
}
define lab => type {
parent dog
}
local(myanimal = lab)
#myanimal -> gender = 'Male'
#myanimal -> gender

View file

@ -0,0 +1,2 @@
-- parent script "Animal"
-- ...

View file

@ -0,0 +1,7 @@
-- parent script "Dog"
property ancestor
on new (me)
me.ancestor = script("Animal").new()
return me
end

View file

@ -0,0 +1,7 @@
-- parent script "Cat"
property ancestor
on new (me)
me.ancestor = script("Animal").new()
return me
end

View file

@ -0,0 +1,7 @@
-- parent script "Lab"
property ancestor
on new (me)
me.ancestor = script("Dog").new()
return me
end

View file

@ -0,0 +1,7 @@
-- parent script "Collie"
property ancestor
on new (me)
me.ancestor = script("Dog").new()
return me
end

View file

@ -0,0 +1,6 @@
type
Animal = object of RootObj
Dog = object of Animal
Cat = object of Animal
Lab = object of Dog
Collie = object of Dog

View file

@ -0,0 +1,5 @@
Object Class new: Animal
Animal Class new: Cat
Animal Class new: Dog
Dog Class new: Lab
Dog Class new: Collie

View file

@ -0,0 +1,5 @@
Class Animal
Class Dog from Animal
Class Cat from Animal
Class Lab from Dog
Class Collie from Dog

View file

@ -0,0 +1,5 @@
class Animal {};
class Dog << Animal {};
class Cat << Animal {};
class Lab << Dog {};
class Collie << Dog {};

View file

@ -0,0 +1,19 @@
class Animal {
// ...
}
class Dog : Animal {
// ...
}
class Lab : Dog {
// ...
}
class Collie : Dog {
// ...
}
class Cat : Animal {
// ...
}

View file

@ -0,0 +1,13 @@
(define-class animal)
(define-class dog
(super-class animal))
(define-class cat
(super-class animal))
(define-class collie
(super-class dog))
(define-class lab
(super-class dog))

View file

@ -0,0 +1,21 @@
[1] (cat 'superclass)
#<Class:ANIMAL #x57094c8>
[2] (collie 'superclass)
#<Class:DOG #x57094c8>
[3] (animal 'superclass)
#<Class:OBJECT #x57094c8>
[4] (dog 'show)
Object is #<Class:DOG #x57094c8>, Class is #<Class:CLASS #x57094c8>
Instance variables:
NAME = DOG
MESSAGES = ()
IVARS = ()
CVARS = #<Environment #x5879788>
SUPERCLASS = #<Class:ANIMAL #x57094c8>
IVARCNT = 0
IVARTOTAL = 0
#<Class:DOG #x57094c8>