My code always gets jumbled up with atoms
and strings
, or strings
and integers
, which causes functions like MapSet.member?
to return false
, even if I am expecting it to be true
. Or I send a %{event: "hello"}
to a process, but it actually expects %{event: hello}
.
To solve this, I create functions like maybe_atom_to_string
or maybe_int_to_string
and put them wherever variables are being sent to another process to keep things consistent.
Is this a code smell? Is there a better way to do this? Do I just need to be more careful when sending messages around processes?