[erlang-questions] Re: What about making sense?

David Mercer <>
Mon Feb 22 16:05:43 CET 2010

On Saturday, February 20, 2010, Joe Armstrong wrote:

> When I write *any* process I always start with something like:
> loop(...) ->
>     receive
>          Any -> io:format("got:~p~n",[Any]),
>          loop(...)
>    end.

Out of curiosity, why do you start with that and not:


	init(_) -> {ok, []}.

	handle_info(Info, State) ->
		{noreply, State}.

Obviously, the semantics are different and all, but I'd have thought if I
were creating a process, I may as well make it a gen-server process so I
don't have to retrofit it into that framework later.



More information about the erlang-questions mailing list