[erlang-questions] Compound guard expression in case

Donald Steven t6sn7gt@REDACTED
Sun Feb 10 20:33:36 CET 2019


Newbie question regarding best practices (including a string of nested ifs):

How do you code the following:

case X of
     4             -> something;
     <2 or >6 -> something else;
     _             -> something else again
end,

and

case X of
     atom1 or atom2 or atom3 -> something;
     atom4                                    -> something else;
     _ ->                                         -> something else again
end,

Thanks!

Don




More information about the erlang-questions mailing list