4 ms·
How is that not ideal? Isn't that a perfectly valid mechanism to implement a 3-valued logic? Perhaps some people would prefer to wrap a standard bool. In Rust,
by timClicks 7y ago
How is that not ideal? Isn't that a perfectly valid mechanism to implement a 3-valued logic?
Perhaps some people would prefer to wrap a standard bool. In Rust, a type of Option(bool) would work. An equivalent in Go would be *bool. But I don't know how the CPU would distinguish between a null pointer and falsehood in that case.
- gauravphoenix 7y agoI said not ideal because of null. I wish there was a better way. Null is way too overloaded in Java.
- AnimalMuppet 7y agoThen don't use null. Use { false, true, 2 } or { false, true, SomeNewEnumerationLabel }.
- gauravphoenix 7y agoyeah, I just wish there was a first class citizen support to represent this. I think Optional<Boolean> should suffice.