Fix issue #51; begin work on atomic types

This commit is contained in:
Ginger Bill
2017-04-28 11:01:46 +01:00
parent b78e970698
commit 99125dc743
12 changed files with 232 additions and 135 deletions
+7 -13
View File
@@ -1,18 +1,12 @@
#import "fmt.odin";
main :: proc() {
immutable program := "+ + * - /";
accumulator := 0;
for token in program {
match token {
case '+': accumulator += 1;
case '-': accumulator -= 1;
case '*': accumulator *= 2;
case '/': accumulator /= 2;
default: // Ignore everything else
}
x: atomic int = 123;
fmt.println(x);
arr :[dynamic]any;
append(arr, "123", 123, 3.14159265359878, true);
for a in arr {
fmt.println(a);
}
fmt.printf("The program \"%s\" calculates the value %d\n", program, accumulator);
fmt.print(arr, "\n");
}