Erlang is getting too big

Vladimir Sekissov svg@REDACTED
Mon Oct 13 22:03:12 CEST 2003


vances>    if
vances>       not ConnectionOriented and not SequenceControl -> Class = 0;
vances>       not ConnectionOriented and SequenceControl -> Class = 1;
vances>       ConnectionOriented and not SequenceControl -> Class = 2;
vances>       ConnectionOriented and SequenceControl -> Class = 3
vances>    end,

How about :)

Class =
      case {ConnectionOriented, SequenceControl} of
         {false, false}  -> 0;
         {false, true}   -> 1;
         {true,  false}  -> 2;
         {true,  true}   -> 4
      end,

Best Regards,
Vladimir Sekissov




More information about the erlang-questions mailing list