News for hackers. Stuff that matters.
Re:My Opinion on “5” == 5 by zajio1am on Thursday July 29, 2021 @01:39PM (#27999133)
> IMO, any language with a type system should enforce comparisons only between those types (or derived types)

There are languages with a type system that have universal type (and all types are derived from it), in these languages it make sense that "5" == 5 is defined and false.

Re:My Opinion on “5” == 5 by int_19h on Thursday July 29, 2021 @04:05PM (#28000804)
A universal type doesn't necessarily have to be arbitrarily comparable between instances. The strictly correct response to "5"==5 really is "not comparable"; it's just a question of how you choose to surface it. One popular choice is to define the equality operator as returning false if the operands aren't comparable - but then you have to do the reverse for inequality, which is far less obvious.