aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-08-05 16:09:19 +0100
committergingerBill <bill@gingerbill.org>2023-08-05 16:09:19 +0100
commitdd7c2c0574ac5df5db78dcec834b6b9db949c679 (patch)
tree81a31f1e7aae818b6b635d698d51bb8087eee87f /examples
parentc91898a8889604617140ad15c70f4d68494fa0a1 (diff)
Update demo for #relative multi-pointers
Diffstat (limited to 'examples')
-rw-r--r--examples/demo/demo.odin11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin
index 5f1e84bbf..6f2a6cf63 100644
--- a/examples/demo/demo.odin
+++ b/examples/demo/demo.odin
@@ -2024,12 +2024,11 @@ relative_data_types :: proc() {
fmt.println(ptr^)
arr := [3]int{1, 2, 3}
- s := arr[:]
- rel_slice: #relative(i16) []int
- rel_slice = s
- fmt.println(rel_slice)
- fmt.println(rel_slice[:])
- fmt.println(rel_slice[1])
+ multi_ptr: #relative(i16) [^]int
+ multi_ptr = &arr[0]
+ fmt.println(multi_ptr)
+ fmt.println(multi_ptr[:3])
+ fmt.println(multi_ptr[1])
}
or_else_operator :: proc() {