top | item 25703189

(no title)

elexhobby | 5 years ago

Wow. I wish everything was explained so clearly. I understood everything in that post except this paragraph.

""" Languages like Erlang must implement tail call optimizations, since persisted data is stored as "loop variables" in infinite loops. This happens when we write code like this:

     loop(Data) ->
          ....
 ...
 loop(newData).
When I see code like this I mentally "see" the last call as a "jump" to the start of the code, rather than a recursive call to loop. """

What is the loop(Data), loop(newData) doing? Would be great if someone could elaborate on this point.

discuss

order

No comments yet.