Open
Description
AIUI, =
means "perform equality check on an object's data" and ==
means "pointer equality". However the latter is overriden for small integers, but not big integers or doubles. So, given this program:
obj1 = (
run = (
(1 == 1) println.
(100 == 100) println.
((1 << 200) == (1 << 200)) println.
(1.0 == 1.0) println.
)
)
the output in java-som is:
true
true
false
false
In the interests of consistency, I tend to think those should all be true
or all be false
. If they should all be false
, then one has trickier cases like 1 == 1.0
and so on. Perhaps reference equality should always return false for numbers?