aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-18 15:09:24 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-18 15:09:24 +0100
commit277ef1a68f932988cd59b40e496b2b1532907654 (patch)
treef36cac2af780eee688be2515bd020a5be3a18c8d /code
parent193c7c82c83022fa16dff6cc611d5673753ece8f (diff)
Allow undefined --- as a struct field default value.
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin25
1 files changed, 3 insertions, 22 deletions
diff --git a/code/demo.odin b/code/demo.odin
index 0dc3448bf..cc3997435 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -110,7 +110,7 @@ get_hash :: proc(s: string) -> u32 {
}
-/*
+
Vector :: struct(N: int, T: type) {
using _: raw_union {
using e: [N]T;
@@ -140,29 +140,13 @@ foo1 :: proc(a: type/Vector) { fmt.println("foo1", a{}); }
foo3 :: proc(a: type/Vector(3, $T)) {fmt.println("foo3", a{}); }
// foo4 :: proc(a: type/Vector3) {}
-*/
-
-
-foo :: proc() -> (f32, f32) {
- return 1, 2;
-}
-
-main :: proc() {
- Vector3 :: struct {
- x: f32 = 1;
- y: f32 = 4;
- z: f32 = 9;
- }
- v := make([dynamic]Vector3, 3);
- array: [100]Vector3;
- v2 := array[50];
- fmt.println(v2);
-/* foo1(Vector(3, f32));
+main :: proc() {
+ foo1(Vector(3, f32));
foo1(Vector3);
foo3(Vector(3, f32));
foo3(Vector3);
@@ -179,9 +163,7 @@ main :: proc() {
v := add(a, b);
fmt.println(v.v);
-*/
-/*
table: Table(string, int);
for i in 0..36 do put(&table, "Hellope", i);
@@ -193,5 +175,4 @@ main :: proc() {
found, _ = find(&table, "World!");
fmt.printf("found is %v\n", found);
-*/
}