Why tail-recursive functions are loops