Re:Building a Cache in Elixir
by throwawaymaths on Tuesday July 12, 2022 @09:57AM
(#32070016)
In Elixir, nil is an atom (a global enum namespace), it's not a special data type that has meaning outside of a convention (heavily supported by the stdlib) that "you should use it to mean nothing"[0]. To hammer this home, nil is meaningless and not generally understood by that convention in Erlang (which often returns undefined).
Elixir/BEAM is strongly typed. There is no coercion going on when you are doing comparisons.
[0] note that in elixir, "if" is in the stdlib, it's sugar over case, and the falsiness of nil is software-level (only false and nil are falsy in elixir, which is sane).
Elixir/BEAM is strongly typed. There is no coercion going on when you are doing comparisons.
[0] note that in elixir, "if" is in the stdlib, it's sugar over case, and the falsiness of nil is software-level (only false and nil are falsy in elixir, which is sane).