[erlang-questions] Getting rid of some repetition.

Christian S chsu79@REDACTED
Tue Mar 18 15:33:36 CET 2008


On Tue, Mar 18, 2008 at 2:55 PM, Kenneth Lundin
<kenneth.lundin@REDACTED> wrote:
>  loop(A0, B0, C0)->
>   {A,B,C} =
>     receive
>      {msg1, A1}-> {A1,B0,C0};
>      {msg2, B1}-> {A0,B1,C0};
>      {msg3, C1}-> {A0,B0,C1};
>      {msg4, A1, C1}-> {A1,B0,C1};
>   end,
>   loop(A1, B1, C1).

I spot a little bug and a syntax error! But I leave it as an exercise
to the reader to find what they are.



More information about the erlang-questions mailing list