4 ms·
> "Go doesn’t support xor (^) and or (|) operator on bool. As it turns out, they are not neccessary. x ^ y is the same as x != y. a = a | b can be written as: i
by thelazydogsback 9y ago
> "Go doesn’t support xor (^) and or (|) operator on bool. As it turns out, they are not neccessary. x ^ y is the same as x != y. a = a | b can be written as: if !a && b { a = true }"
Well, you don't need subtraction, division or multiplication either (or any number more than 1!), but they're certainly nice to have.
Go has some nice qualities, but its choice of omissions continues to fascinate me.
- tomjakubowski 9y agoYou can put (some of?) your fascination to rest, Go has ||. https://play.golang.org/p/_GKbk_GUAe https://play.golang.org/p/_GKbk_GUAe