Can messages be sent to processes interactively?
Fri May 21 22:32:35 CEST 1999
> start() -> spawn(sample, server, ).
> server() ->
> stop -> ok;
> Msg ->
> io:fwrite("message received: ~w\n", [Msg]),
> This compiles just fine, and I can start the process from the Erlang
> prompt with P = sample:start(), which results in a valid pid. "P ! 1."
> from the command line, though, doesn't result in any fwrite output,
> though. process_info(P) returns an atom of 'undefined'.
One little error there, the call
calls a function (called "server") with 1 (one) argument in
the local module.
Nu such function exists, thus the process will exit.
Since the process has no links to any other processes
it will silently exit, thus the
> process_info(P) returns an atom of 'undefined'.
and you'll be on your way
More information about the erlang-questions