Operators

5.2 Comparison

Term ordering (any two terms can be compared): number < atom < reference < function < port < pid < tuple < map < list < bitstring

⚠️ Comparing dates/structs with < compares structurally — use Date.compare/2, DateTime.compare/2, or Enum.sort(dates, Date).

1 == 1.0     # true  (value equality)
1 === 1.0    # false (strict: type must match)
1 != 2, 1 !== 1.0
1 < 2, "a" < "b"

5.3 Boolean operators

# Strict: first argument MUST be a boolean
true and false     # false
false or true      # true
not true           # false

# Relaxed: work on any value; only false and nil are falsy
nil || "default"   # "default"
"x" && "y"         # "y"
!nil               # true

5.4 Other operators

binary/string concatenation list concatenation / subtraction in / not in membership: 1 in [1,2] range / range with step type spec / binary modifiers cons / map update regex / substring match