<span class="Apple-style-span" style="border-collapse: collapse; "><div>I'd favour omitting the "or" and I would tend to format it like this...</div><div><br></div>case Expr of<br> Pat -> Expr ;<br>case Expr of<br>
Pat -> Expr ;<br> Pat -> Expr </span><div><span class="Apple-style-span" style="border-collapse: collapse;">end.<br></span><div><br></div><div>After all the case's are piers and belong at the same indent level. If we do go with an "or", isn't the ";" redundant? Semantically, I've always considered ";" to mean "or" and "," to mean "and" in Erlang.</div>
<div><br></div><div>I can appreciate Richard's "unique" formatting style. Unfortunately, optional preceding ";" is not allowed on the first pattern.</div><div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">case Expr of </span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "> ; Pat -> Expr</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; ">or case Expr of</span></div><div><span class="Apple-style-span" style="border-collapse: collapse; "> ; Pat -> Expr </span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "> ; Pat -> Expr </span><div><span class="Apple-style-span" style="border-collapse: collapse; ">end.</span></div></div><div> <br><div><br><div class="gmail_quote">
2008/12/19 Robert Virding <span dir="ltr"><<a href="mailto:rvirding@gmail.com">rvirding@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2008/12/19 Ulf Wiger <span dir="ltr"><<a href="mailto:ulf@wiger.net" target="_blank">ulf@wiger.net</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
2008/12/19 Raimo Niskanen <<a href="mailto:raimo%2Beeps@erix.ericsson.se" target="_blank">raimo+eeps@erix.ericsson.se</a>>:<br>
<div>> I would like you to submit comments regarding EEP-25 on the<br>
> <a href="mailto:eeps@erlang.org" target="_blank">eeps@erlang.org</a> mailing list.<br>
<br>
</div><div class="Ih2E3d">I for one find it acceptable. The "; or case" construct is ok -<br>
perhaps not extremely elegant, but conveys the meaning<br>
very well.</div></blockquote><div><br>Note that "; or case" is Richard's O'Keefe's way of writing it, "normally" it would look like:<br><br>case Expr of<br> Pat -> Expr ;<br> or case Expr of<br>
Pat -> Expr ;<br> Pat -> Expr ;<br> or case ...<br><br>Richard prefers using the separators as a form of keyword. You probably don't need the extra 'or' though it might make it clearer.<br><br>
As an alternative suggestion is to have cond but to extend the test to have a boolena match:<br><br>cond<br> test1() -> ... ;<br> Pat = expr() -> ... ;<br> ...<br>end<br><br>and allow guards. It wouldn't be as versatile as the suggestion in the EEP.<br>
<br>Robert<br><br></div></div>
<br>_______________________________________________<br>
eeps mailing list<br>
<a href="mailto:eeps@erlang.org">eeps@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/eeps" target="_blank">http://www.erlang.org/mailman/listinfo/eeps</a><br></blockquote></div><br></div></div></div>