title: Erlang - undefined function
body: <p>I'm trying to execute a very simple Erlang code, and it's not working.
  I've tryied executed some hello worlds without problem, but not mine own code.</p>
  
  <pre><code>-module(server).
  %% Exported Functions
  -export([start/0, process_requests/1]).
  %% API Functions
  start() -&gt;
      ServerPid = spawn(server, process_requests, [[]]),
      register(myserver, ServerPid).
  process_requests(Clients) -&gt;
      receive
           {client_join_req, Name, From} -&gt;
           NewClients = [From|Clients],  %% TODO: COMPLETE
              broadcast(NewClients, {join, Name}),
              process_requests(NewClients);  %% TODO: COMPLETE
          {client_leave_req, Name, From} -&gt;
              NewClients = lists:delete(From, Clients),  %% TODO: COMPLETE
              broadcast(Clients, {leave, Name}),  %% TODO: COMPLETE
              process_requests(NewClients);  %% TODO: COMPLETE
          {send, Name, Text} -&gt;
              broadcast(Clients, {message, Name, Text}),  %% TODO: COMPLETE
              process_requests(Clients)
  end.
  %% Local Functions
  broadcast(PeerList, Message) -&gt;
      Fun = fun(Peer) -&gt; Peer ! Message end,
      lists:map(Fun, PeerList). 
  </code></pre>
  
  <p>Compile result:</p>
  
  <pre><code>5&gt; c(server).
      {ok,server}
  6&gt; server:start().       
  ** exception error: undefined function server:start/0
  </code></pre>