> “How can you sum the numbers from 1 to 10 without using a loop?” ... And there it was: recursion. Wait, is there something I don’t actually understand about recursion? When a recursive function calls itself, is that not a loop?
defmodule Server do
def start_link do
spawn_link(&loop/0)
end
defp loop do
receive do
msg ->
IO.puts(msg)
loop()
end
end
end