aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-05-13 12:06:35 +0100
committergingerBill <bill@gingerbill.org>2021-05-13 12:06:35 +0100
commitb8a35c658cf30a3f4f46ec40b38cdf478224a371 (patch)
tree496209a0ffa135ebc5f9a63e87f103cbd11200ee /examples
parent465b6139d55441fbe6da8d2699865c414cd87d3a (diff)
Remove incl/excl usage from demo
Diffstat (limited to 'examples')
-rw-r--r--examples/demo/demo.odin10
-rw-r--r--examples/demo_insert_semicolon/demo.odin10
2 files changed, 10 insertions, 10 deletions
diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin
index 6817b15a4..76e8aa9fc 100644
--- a/examples/demo/demo.odin
+++ b/examples/demo/demo.odin
@@ -1352,8 +1352,8 @@ bit_set_type :: proc() {
d: Days;
d = {Sunday, Monday};
- e := d | WEEKEND;
- e |= {Monday};
+ e := d + WEEKEND;
+ e += {Monday};
fmt.println(d, e);
ok := Saturday in e; // `in` is only allowed for `map` and `bit_set` types
@@ -1372,12 +1372,12 @@ bit_set_type :: proc() {
fmt.println(typeid_of(type_of(x))); // bit_set[A..Z]
fmt.println(typeid_of(type_of(y))); // bit_set[0..8; u16]
- incl(&x, 'F');
+ x += {'F'};
assert('F' in x);
- excl(&x, 'F');
+ x -= {'F'};
assert('F' not_in x);
- y |= {1, 4, 2};
+ y += {1, 4, 2};
assert(2 in y);
}
{
diff --git a/examples/demo_insert_semicolon/demo.odin b/examples/demo_insert_semicolon/demo.odin
index ae677e5a9..3fbae274e 100644
--- a/examples/demo_insert_semicolon/demo.odin
+++ b/examples/demo_insert_semicolon/demo.odin
@@ -1347,8 +1347,8 @@ bit_set_type :: proc() {
d: Days
d = {Sunday, Monday}
- e := d | WEEKEND
- e |= {Monday}
+ e := d + WEEKEND
+ e += {Monday}
fmt.println(d, e)
ok := Saturday in e // `in` is only allowed for `map` and `bit_set` types
@@ -1367,12 +1367,12 @@ bit_set_type :: proc() {
fmt.println(typeid_of(type_of(x))) // bit_set[A..Z]
fmt.println(typeid_of(type_of(y))) // bit_set[0..8; u16]
- incl(&x, 'F')
+ x += {'F'};
assert('F' in x)
- excl(&x, 'F')
+ x -= {'F'};
assert('F' not_in x)
- y |= {1, 4, 2}
+ y += {1, 4, 2}
assert(2 in y)
}
{