global_name_server question.

Luke Gorrie <>
Wed Jun 2 21:46:40 CEST 1999


Vladimir Ulogov <> writes:

> Folks,
> I'd have another dumb question about "registered" process.
> Here is a erlang code:
> %%-------------------------------------------------
> start() ->
>      Rec = spawn(dumb_eh, receiver, []),
>      register(eh, Rec).
> %%--------------------------------------------------
> receiver() ->
>      receive
>          Message ->
> 	     io:format("Recv: ~w~n", Message),

^^^ This looks suspicious -- I believe you want:
        io:format("Recv: ~w~n", [Message]),

i.e., Message inside a list.  Instead of raising an error on that sort 
of problem, format just returns {error,format}, so it's easy to miss.

Cheers,
Luke





More information about the erlang-questions mailing list