aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-03 18:02:13 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-03 18:02:13 +0000
commita86896e4d30b118287cf2111cd2fbec00ed2be70 (patch)
tree15198095de38744739e239bfac3c160dfa936d58 /code
parenta3883a178c1e4e10058089a2832004a6ce1521e2 (diff)
Interval expressions in `range`
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin16
1 files changed, 10 insertions, 6 deletions
diff --git a/code/demo.odin b/code/demo.odin
index 05a9dfd50..05307c40f 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -18,12 +18,16 @@ Thing :: enum f64 {
}
main :: proc() {
- msg := "Hello";
- range index, value : msg {
- fmt.println(index, value);
- }
+ msg := "Hellope";
list := []int{1, 4, 7, 3, 7, 2, 1};
- range index, value : list {
- fmt.println(index, value);
+
+ range value : msg {
+ fmt.println(value);
+ }
+ range value : list {
+ fmt.println(value);
+ }
+ range x : 0 ..< 5 {
+ fmt.println(x);
}
}