The Erlang User’s Guide describes the send operator as
8.9 Send
Expr1 ! Expr2Sends the value of
Expr2as a message to the process specified by
Expr1. The value ofExpr2is also the return value of the
expression.
Expr1must evaluate to a pid, a registered name (atom), or a tuple
{Name,Node}.Nameis an atom andNodeis a node name, also an
atom.
- If
Expr1evaluates to a name, but this name is not registered, abadargrun-time error occurs.- Sending a message to a pid never fails, even if the pid identifies a non-existing process.
- Distributed message sending, that is, if
Expr1evaluates to a tuple{Name,Node}(or a pid located at another node), also never
fails.
In the case of distributed message sending, it is not clear to me what the first atom represents in {Name,Node} from the code of the remote node or process.
Your help is appreciated.
The grammar is a bit ambiguous in the sentence you’re citing. The three options are:
The first is by far the most common. Registered names are intended to be used judiciously.
I’d recommend starting with the concurrency chapter from Learn You Some Erlang, and backtracking as necessary to earlier chapters:
http://learnyousomeerlang.com/the-hitchhikers-guide-to-concurrency#dont-panic