32 ms·
Clause order matters. -- -module(ping). -export([ping/2]). ping(N, Pid) -> Pid ! ping, receive pong -> ping(N-1, Pi
by lpgauth 13y ago
Clause order matters.
--
-module(ping).
-export([ping/2]).
ping(N, Pid) ->
Pid ! ping,
receive
pong ->
ping(N-1, Pid)
end;
ping(0, _Pid) ->
ok.
erlc ping.erl
ping.erl:10: Warning: this clause cannot match because a
previous clause at line 4 always matches
- vinoski 13y agoCorrect -- immediately after the video was posted to InfoQ I posted a comment there to clarify and correct that error: http://www.infoq.com/presentations/Erlang-OTP-Behaviors#anch89741 http://www.infoq.com/presentations/Erlang-OTP-Behaviors#anch...