<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Take this as a code smell.  There is probably an abstraction missing in your</div><div class="gmail_default" style="font-family:monospace,monospace">data struc<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 23 Mar 2019 at 20:40, Florent Gallaire <<a href="mailto:fgallaire@gmail.com">fgallaire@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello everybody,<br>
<br>
I'm not very experimented in Erlang but I read carefully books and<br>
official documention.<br>
<br>
It seems to me that the guards syntax is not as good as it should be,<br>
i.e. too much verbose for multiple values.<br>
<br>
do(val1) -> val1;<br>
do(val2) -> val2;<br>
do(val3) -> val3;<br>
do(val4) -> val4;<br>
do(val5) -> val5.<br>
<br>
do(Val) when Val =:= val1; Val =:= val2; Val =:= val3; Val =:= val4;<br>
Val =:= val5 -> Val.<br>
<br>
It's boring and error prone to write.<br>
<br>
Has a "in tuple" syntax already be considered ? Something like :<br>
<br>
do(Val) when Val in {val1, val2, val3, val4, val5} -> Val.<br>
<br>
Cheers<br>
<br>
Florent<br>
<br>
-- <br>
FLOSS Engineer & Lawyer<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>