aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-15 19:55:04 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-15 19:55:04 +0000
commitac736aa4ecf5dce7b1dbd4c5ef3758f8f2008ebc (patch)
treeb7d30f39fb13723d33de2b0a5f4029873f25a205 /code
parent6fe25badf067d63c79999814f46be0ac79a39ef8 (diff)
Procedure overloading
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin20
1 files changed, 15 insertions, 5 deletions
diff --git a/code/demo.odin b/code/demo.odin
index b26adee95..7c9e206ba 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -1,9 +1,19 @@
#import "fmt.odin";
main :: proc() {
- fmt.printf("%f\n", 0.0);
- fmt.printf("%f\n", 1.0);
- fmt.printf("%f\n", -0.5);
- fmt.printf("%+f\n", 1334.67);
- fmt.printf("%f\n", 789.789);
+ foo :: proc() {
+ fmt.printf("Zero args\n");
+ }
+ foo :: proc(i: int) {
+ fmt.printf("One arg, i=%d\n", i);
+ }
+ THING :: 14451;
+
+ foo();
+ foo(THING);
+ fmt.println(THING);
+
+ x: proc();
+ x = foo;
+ x();
}