CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
3
Task/Enumerations/E/enumerations-1.e
Normal file
3
Task/Enumerations/E/enumerations-1.e
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
def apple { to value() { return 0 } }
|
||||
def banana { to value() { return 1 } }
|
||||
def cherry { to value() { return 2 } }
|
||||
6
Task/Enumerations/E/enumerations-2.e
Normal file
6
Task/Enumerations/E/enumerations-2.e
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
interface Fruit guards FruitStamp {}
|
||||
def apple implements FruitStamp {}
|
||||
def banana implements FruitStamp {}
|
||||
def cherry implements FruitStamp {}
|
||||
|
||||
def eat(fruit :Fruit) { ... }
|
||||
4
Task/Enumerations/E/enumerations-3.e
Normal file
4
Task/Enumerations/E/enumerations-3.e
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
def [Fruit, [=> apple, => banana, => cherry]] := makeEnumeration()
|
||||
|
||||
def [Fruit, [=> apple, => banana, => cherry]] :=
|
||||
makeEnumeration(0, ["apple", "banana", "cherry"])
|
||||
Loading…
Add table
Add a link
Reference in a new issue