As from the title: I am a bit confused on why two composite types with all bitstypes members are different if they are defined mutable ?
mutable struct Foo
x::Bool
end
struct Goo
x::Bool
end
julia> f1 = Foo(true)
Foo(true)
julia> f2 = Foo(true)
Foo(true)
julia> f1 == f2
false
julia> g1 = Goo(true)
Goo(true)
julia> g2 = Goo(true)
Goo(true)
julia> g1 == g2
true
Let me see if I got it while writing this question… the Goo
instances do memorize the actual bool value, while the Foo
instances memorize only the memory address of them. This memory address is different between f1
and f2
.
Still, I would have expected the ===
operator to fail, while I would have expected ==
to lookup these memory addresses and look that the actual bit values are the same (true) for both objects…