I’m on Elixir 1.12.3 (compiled with Erlang/OTP 24).
I’m running into interesting behaviors that stem from [int] being interpreted differently for certain low values.
For example, while [5] gets inspected as [5], [6] becomes ‘\a’.
Is there a way to force Elixir to interpret [int] as an array of a single int?
Full code:
for i <- 0..40, do: inspect [i]
["[0]", "[1]", "[2]", "[3]", "[4]", "[5]", "[6]", "'\\a'", "'\\b'", "'\\t'",
"'\\n'", "'\\v'", "'\\f'", "'\\r'", "[14]", "[15]", "[16]", "[17]", "[18]",
"[19]", "[20]", "[21]", "[22]", "[23]", "[24]", "[25]", "[26]", "'\\e'",
"[28]", "[29]", "[30]", "[31]", "' '", "'!'", "'\"'", "'#'", "'$'", "'%'",
"'&'", "'\\''", "'('"]
I’d appreciate any pointers. Thanks!