254628 (1) [Avatar] Offline
#1
My solution of range/2 was sometimes giving strings not integers in IEx, which was a bit confusing. I loaded the reference solution and it did the same.

iex(3)> RecursionPracticeTc.range(10,13)
'\n\v\f\r'

iex(5)> RecursionPracticeTc.range(11,15)
[11, 12, 13, 14, 15]



Simplifying everything I tried

iex(8)> [10]
'\n'
iex(9)> [15]
[15]


I reread the strings section in 2.4.8 and the answer was there...
even the runtime doesn't distinguish between a list of integers and a character list. When a list consists of integers that represent printable characters, it's printed to the screen in string form.





sjuric (86) [Avatar] Offline
#2
Yes, this is a common pitfall for people arriving to Erlang smilie

For the next edition, I'll consider including a reminder about that issue in the recursion section.