Something clever in the syntax of Elixir
2023-11-25
elixir
I find this quite clever in the syntax of Elixir.
There are two sets of boolean operators in Elixir and
, or
, not
versus &&
, ||
, !
.
The difference is that and
, or
, not
only take literal boolean values. In contrast, &&
, ||
, !
can take values of all types. And all values except false
and nil
will evaluate to true
. ⋯