News for hackers. Stuff that matters.
Re:Don't Use Booleans by frou_dh on Tuesday July 09, 2024 @05:39AM (#40914131)
> You can think of booleans as a built-in, two-value enum that has a common semantic meaning.

I love it when a language's bool type is just a sum-type like the sum-types you define in user code, e.g. https://ocaml.org/manual/5.2/core.html#hevea_manual10. It's an indicator of a language with good foundations.

Re:Don't Use Booleans by xigoi on Tuesday July 09, 2024 @01:31PM (#40918707)
I agree. Nim’s booleans are an enum too: https://nim-lang.org/docs/system.html#bool