Boolean operator?

var b: bool = true;
const n: bool = false;
b |= n;

Strange…
Why can’t we do operations on booleans?
How are we supposed to handle this?

1 Like
b = b or n;

The and and or operators can modify the control flow, so they’re defined as a keyword. The | and & operators are bitwise operations.

7 Likes

ok. yes. thanks. picked up Zig after a few months again. confusion solved :slight_smile: