I came across some very strange behavior when mapping Integer.parse
over a map of strings in Elixir. I executed the following:
Enum.map(["7", "8", "9"], &elem(Integer.parse(&1), 0))
Which resulted in the following output: '\a\b\t'
.
Oddly enough if I change the "7" it behaves as I would expect:
`Enum.map(["4", "8", "9"], &elem(Integer.parse(&1), 0))`
Results in [4, 8, 9]
Further experimentation shows that there is similar behavior for every leading number greater than 6 but less than 14
For example Enum.map(["11", "8", "10"], &elem(Integer.parse(&1), 0))
results in '\v\b\n'
but Enum.map(["16", "8", "10"], &elem(Integer.parse(&1), 0))
results in [16, 8, 10]
Any explanation for this?