diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-01-17 15:20:11 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-01-17 15:20:11 +0000 |
| commit | 383f5b55ad76d6b670b6ae7e2816cc4d8f0d8731 (patch) | |
| tree | f3f3b9affae69d2c4a2f0c9406a5df708faed486 /code | |
| parent | 6dc6b6f8aaa3289ae32746367089f9f77be9a623 (diff) | |
Best viable overloading procedure algorithm; `no_alias`; call expr style casts
Diffstat (limited to 'code')
| -rw-r--r-- | code/demo.odin | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/code/demo.odin b/code/demo.odin index c7c13ade0..9133e036d 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -2,9 +2,23 @@ #import "fmt.odin"; #import "math.odin"; #import "mem.odin"; -#import "opengl.odin"; main :: proc() { + foo :: proc(x: ^int) { + fmt.println("^int"); + } + foo :: proc(x: rawptr) { + fmt.println("rawptr"); + } + + a: ^int; + b: ^f32; + c: rawptr; + foo(a); + foo(b); + foo(c); + // foo(nil); + foo :: proc() { fmt.printf("Zero args\n"); } @@ -18,13 +32,16 @@ main :: proc() { THINGI :: 14451; THINGF :: 14451.1; + foo(); foo(THINGI as int); + foo(int(THINGI)); + // foo(THINGI); foo(THINGF); fmt.println(THINGI); fmt.println(THINGF); - x: proc(); - x = foo; - x(); + f: proc(); + f = foo; + f(); } |