<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I believe this is not quite the same thing as your proposition would require for each a, b, c to be expressions that could be used in guards whereas I was looking for a generic way to be able to join several matches in a single 'case' branch (in the spirit of the C's multiple subsequent case statements):<br><br>case {Ctrl, Char} of<br> {ctrl, _} -></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> ignore;<br> {_, $\n} | {_, $\r} -><br> end_of_line;</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> Other -></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"> Other</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">end.<br> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 9, 2015 at 3:52 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Closer to Erlang syntax would be something like:<br>
<br>
case SomeVar of<br>
V when V in [a, b, c] -> true;<br>
_ -> false<br>
end<br>
<br>
Or better yet:<br>
<br>
if<br>
SomeVar in [a, b, c] -> true;<br>
true -> false<br>
end<br>
<br>
You can generalize with variables (SomeVar in List) though the compiler probably won't be able to optimize those away.<br>
<br>
Of course the whole "returning a boolean" makes no sense, you probably want a function call in its place instead.<br>
<br>
On 07/09/2015 07:44 PM, Serge Aleynikov wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Though it's a bit off topic, but I'd love to see a different kind of<br>
application of '|' supported by syntax (yet probably ';' would be more<br>
in the "Erlang" spirit for the task):<br>
<br>
case SomeVar of<br>
a | b | c -><br>
true;<br>
_ -><br>
false<br>
end.<br>
<br>
<br>
<br>
On Thu, Jul 9, 2015 at 11:24 AM, Volkert<br>
<<a href="mailto:volkert@komponentenwerkstatt.de" target="_blank">volkert@komponentenwerkstatt.de</a><br>
<mailto:<a href="mailto:volkert@komponentenwerkstatt.de" target="_blank">volkert@komponentenwerkstatt.de</a>>> wrote:<br>
<br>
Dear all,<br>
<br>
I really love the Pipe Operator |> in Elixir and F#.<br>
<br>
Are there any plans to have this in Erlang?<br>
<br>
Volkert<br>
<br>
<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a> <mailto:<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>
<br>
<br>
<br>
<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>
<br><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
Loïc Hoguin<br>
<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
Author of The Erlanger Playbook,<br>
A book about software development using Erlang<br>
</font></span></blockquote></div><br></div>