++ --
iex> [1,2,3] ++ [4,5,6]
[1,2,3,4,5,6]
iex> [1,2,3] -- [2]
[1,3]
iex> [1,2,2,3] -- [2]
[1,2,3]
iex> [1,3,2] -- [2,3]
[1]
<>
iex> "foo" <> "bar"
"foobar"
iex> "foo" <> 1
argument error
論理演算子 ( and or not )
iex> true and true
true
iex> true and false
false
iex> true and not false
true
iex> 1 and true
argument error
iex> 1 == 1 and true
true
論理演算子 ( || && ! )
- and or not と同じ
- こちらはfalseとnil以外はtrueと判定する差異がある
iex> true && true
true
iex> true && false
false
iex> true && ! false
true
iex> 1 && true
true
iex> 1 == 1 && true
true
比較演算子 (==, !=, ===, !==, <=, >=, <, > )
- この辺は他の言語と変わらない
- == と === は厳密に型を見るかの違い
- 型の違う値も比較できる
- 型によって強弱が決まっている
- number < atom < reference < functions < port < pid < tuple < maps < list < bitstring
iex> 1 == 1.0
true
iex 1 === 1.0
false
iex> 1 < :atom
true