1

Here is the interactive run:

username@system dir % iex

iex(7)> 1..(5*20) |> Enum.to_list |> Enum.chunk_every(20)
[
  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
  [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
   40],
  ')*+,-./0123456789:;<',
  '=>?@ABCDEFGHIJKLMNOP',
  'QRSTUVWXYZ[\\]^_`abcd'
]

iex(3)> 1..(5*20) |> Enum.to_list |> Enum.chunk_every(20) |> Enum.at(1)
[21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]

iex(4)> 1..(5*20) |> Enum.to_list |> Enum.chunk_every(20) |> Enum.at(2)
')*+,-./0123456789:;<'

iex(5)> 1..(5*20) |> Enum.to_list |> Enum.chunk_every(20) |> Enum.at(2) |> Enum.at(0)
41

Can anyone make sense of why the interactive shell would parse the lists this way? Something special about codepoint 41?

cppProgrammer
  • 349
  • 1
  • 2
  • 12

0 Answers0