ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  An Introduction to Erlang
Subject:   Recursion? Goto?
Date:   2007-12-20 19:37:17
From:   rickhg12hs
A complete newbie question ...


Regarding:

loop(MyName) ->
receive
{ accept, SenderName, Message } ->
io:format("~n~s receives from ~s: ~s ~n", [MyName, SenderName, Message]),
loop(MyName);


{ say, Message } ->
io:format("~n~s says ~s ~n",[MyName, Message]),
room ! { self(), broadcast, MyName, Message },
loop(MyName)


end.


Is "loop(MyName)" a recursive call? ... a goto? What happens under the hood? E.g., is a completely new call stack generated for each "loop(MyName)"?


Thanks for the intro article. It's got me interested in Erlang.


1 to 1 of 1
  1. Gregory Brown photo Recursion? Goto?
    2007-12-21 03:46:33  Gregory Brown | O'Reilly AuthorO'Reilly Blogger [View]

    • Recursion? Goto?
      2007-12-21 18:20:52  rickhg12hs [View]

      • Recursion? Goto?
        2008-01-09 21:19:11  MattKangas [View]

1 to 1 of 1