[erlang-questions] Getting rid of some repetition.

Kenneth Lundin kenneth.lundin@REDACTED
Tue Mar 18 16:45:14 CET 2008


On 3/18/08, Christian S <chsu79@REDACTED> wrote:
> 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(A, B, C).
>
> I spot a little bug and a syntax error! But I leave it as an exercise
> to the reader to find what they are.
>
Bug fixed, sorry for that

/Kenneth



More information about the erlang-questions mailing list