aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin14
1 files changed, 7 insertions, 7 deletions
diff --git a/code/demo.odin b/code/demo.odin
index ec5ccfb40..21cfb6f63 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -1,13 +1,13 @@
#import "fmt.odin";
main :: proc() {
- foo :: proc() -> [dynamic]int {
- x: [dynamic]int;
- append(^x, 2, 3, 5, 7);
- return x;
- }
+ x: [dynamic]f64;
+ defer free(x);
+ append(^x, 2_000_000.500_000, 3, 5, 7);
- for p in foo() {
- fmt.println(p);
+ for p, i in x {
+ if i > 0 { fmt.print(", "); }
+ fmt.print(p);
}
+ fmt.println();
}