langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
4
Task/Enumerations/OCaml/enumerations.ocaml
Normal file
4
Task/Enumerations/OCaml/enumerations.ocaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
type fruit =
|
||||
| Apple
|
||||
| Banana
|
||||
| Cherry
|
||||
11
Task/Enumerations/Objeck/enumerations.objeck
Normal file
11
Task/Enumerations/Objeck/enumerations.objeck
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
enum Color := -3 {
|
||||
Red,
|
||||
White,
|
||||
Blue
|
||||
}
|
||||
|
||||
enum Dog {
|
||||
Pug,
|
||||
Boxer,
|
||||
Terrier
|
||||
}
|
||||
6
Task/Enumerations/Oz/enumerations-1.oz
Normal file
6
Task/Enumerations/Oz/enumerations-1.oz
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
declare
|
||||
fun {IsFruit A}
|
||||
{Member A [apple banana cherry]}
|
||||
end
|
||||
in
|
||||
{Show {IsFruit banana}}
|
||||
4
Task/Enumerations/Oz/enumerations-2.oz
Normal file
4
Task/Enumerations/Oz/enumerations-2.oz
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
declare
|
||||
Apple = 1
|
||||
Banana = 2
|
||||
Cherry = 3
|
||||
8
Task/Enumerations/Oz/enumerations-3.oz
Normal file
8
Task/Enumerations/Oz/enumerations-3.oz
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
declare
|
||||
proc {Enumeration Xs}
|
||||
Xs = {List.number 1 {Length Xs} 1}
|
||||
end
|
||||
|
||||
[Apple Banana Cherry] = {Enumeration}
|
||||
in
|
||||
{Show Cherry}
|
||||
3
Task/Enumerations/PL-I/enumerations.pli
Normal file
3
Task/Enumerations/PL-I/enumerations.pli
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
define ordinal animal (frog, gnu, elephant, snake);
|
||||
|
||||
define ordinal color (red value (1), green value (3), blue value (5));
|
||||
8
Task/Enumerations/Perl-6/enumerations.pl6
Normal file
8
Task/Enumerations/Perl-6/enumerations.pl6
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
enum Fruit <Apple Banana Cherry>; # Numbered 0 through 2.
|
||||
|
||||
enum ClassicalElement (
|
||||
Earth => 5,
|
||||
'Air', # Gets the value 6.
|
||||
Fire => 'hot',
|
||||
Water => 'wet'
|
||||
);
|
||||
5
Task/Enumerations/PureBasic/enumerations-1.purebasic
Normal file
5
Task/Enumerations/PureBasic/enumerations-1.purebasic
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Enumeration
|
||||
#Apple
|
||||
#Banana
|
||||
#Cherry
|
||||
EndEnumeration
|
||||
7
Task/Enumerations/PureBasic/enumerations-2.purebasic
Normal file
7
Task/Enumerations/PureBasic/enumerations-2.purebasic
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
Enumeration 10200 Step 12
|
||||
#Constant1 ; 10200
|
||||
#Constant2 ; 10212
|
||||
#Constant3 ; 10224
|
||||
#Constant4 = 10117 ; 10117
|
||||
#Constant5 ; 10229
|
||||
EndEnumeration
|
||||
4
Task/Enumerations/PureBasic/enumerations-3.purebasic
Normal file
4
Task/Enumerations/PureBasic/enumerations-3.purebasic
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Enumeration #PB_Compiler_EnumerationValue
|
||||
#Constant_A ; 10241
|
||||
#Constant_B ; 10242
|
||||
EndEnumeration
|
||||
1
Task/Enumerations/Raven/enumerations.raven
Normal file
1
Task/Enumerations/Raven/enumerations.raven
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ 'apple' 0 'banana' 1 'cherry' 2 } as fruits
|
||||
6
Task/Enumerations/Retro/enumerations-1.retro
Normal file
6
Task/Enumerations/Retro/enumerations-1.retro
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
needs enum'
|
||||
( Creating a series of values )
|
||||
0 ^enum'enum| a b c d |
|
||||
|
||||
( Create values individually )
|
||||
0 ^enum'enum a ^enum'enum b
|
||||
3
Task/Enumerations/Retro/enumerations-2.retro
Normal file
3
Task/Enumerations/Retro/enumerations-2.retro
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
with enum'
|
||||
[ 10 * ] is step
|
||||
0 ^enum'enum| a b c d |
|
||||
3
Task/Enumerations/Seed7/enumerations.seed7
Normal file
3
Task/Enumerations/Seed7/enumerations.seed7
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
const type: fruits is new enum
|
||||
apple, banana, cherry
|
||||
end enum;
|
||||
4
Task/Enumerations/Slate/enumerations-1.slate
Normal file
4
Task/Enumerations/Slate/enumerations-1.slate
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
define: #Fruit &parents: {Cloneable}.
|
||||
Fruit traits define: #Apple -> Fruit clone.
|
||||
Fruit traits define: #Banana -> Fruit clone.
|
||||
Fruit traits define: #Cherry -> Fruit clone.
|
||||
3
Task/Enumerations/Slate/enumerations-2.slate
Normal file
3
Task/Enumerations/Slate/enumerations-2.slate
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
define: #Apple -> 1.
|
||||
define: #Banana -> 2.
|
||||
define: #Cherry -> 3.
|
||||
1
Task/Enumerations/Slate/enumerations-3.slate
Normal file
1
Task/Enumerations/Slate/enumerations-3.slate
Normal file
|
|
@ -0,0 +1 @@
|
|||
ensureNamespace: #fruit &slots: {#Apple -> 1. #Banana -> 2. #Cherry -> 3}.
|
||||
1
Task/Enumerations/Slate/enumerations-4.slate
Normal file
1
Task/Enumerations/Slate/enumerations-4.slate
Normal file
|
|
@ -0,0 +1 @@
|
|||
define: #fruit &builder: [{#Apple -> 1. #Banana -> 2. #Cherry -> 3} as: Dictionary].
|
||||
4
Task/Enumerations/Standard-ML/enumerations.ml
Normal file
4
Task/Enumerations/Standard-ML/enumerations.ml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
datatype fruit =
|
||||
Apple
|
||||
| Banana
|
||||
| Cherry
|
||||
3
Task/Enumerations/Toka/enumerations.toka
Normal file
3
Task/Enumerations/Toka/enumerations.toka
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
needs enum
|
||||
0 enum| apple banana carrot |
|
||||
10 enum| foo bar baz |
|
||||
23
Task/Enumerations/VBA/enumerations.vba
Normal file
23
Task/Enumerations/VBA/enumerations.vba
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
'this enumerates from 0
|
||||
Enum fruits
|
||||
apple
|
||||
banana
|
||||
cherry
|
||||
End Enum
|
||||
|
||||
'here we use our own enumeration
|
||||
Enum fruits2
|
||||
pear = 5
|
||||
mango = 10
|
||||
kiwi = 20
|
||||
pineapple = 20
|
||||
End Enum
|
||||
|
||||
|
||||
Sub test()
|
||||
Dim f As fruits
|
||||
f = apple
|
||||
Debug.Print "apple equals "; f
|
||||
Debug.Print "kiwi equals "; kiwi
|
||||
Debug.Print "cherry plus kiwi plus pineapple equals "; cherry + kiwi + pineapple
|
||||
End Sub
|
||||
13
Task/Enumerations/Visual-Basic-.NET/enumerations.visual
Normal file
13
Task/Enumerations/Visual-Basic-.NET/enumerations.visual
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
' Is this valid?!
|
||||
Enum fruits
|
||||
apple
|
||||
banana
|
||||
cherry
|
||||
End Enum
|
||||
|
||||
' This is correct
|
||||
Enum fruits
|
||||
apple = 0
|
||||
banana = 1
|
||||
cherry = 2
|
||||
End Enum
|
||||
2
Task/Enumerations/XPL0/enumerations.xpl0
Normal file
2
Task/Enumerations/XPL0/enumerations.xpl0
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def \Fruit\ Apple, Banana, Cherry; \Apple=0, Banana=1, Cherry=2
|
||||
def Apple=1, Banana=2, Cherry=4;
|
||||
Loading…
Add table
Add a link
Reference in a new issue