Given the following code
defmodule Test do
def run do
p1 = {1, 2}
m1 = %{a: p1}
m2 = %{a: p1}
IO.puts :erts_debug.same(m1.a, m2.a)
m3 = %{b: p1}
IO.puts :erts_debug.same(m1.a, m3.b)
end
end
why does Test.run
prints this
iex(1)> Test.run
true <--- expected
false <--- not true ?!
:ok
Why are m1.a
and m3.b
not the same in-memory tuple?