[eeps] Request for comments on EEP-25 "Unnesting cases"

Dave Smith <>
Sat Dec 20 01:47:13 CET 2008


I'd favour omitting the "or" and I would tend to format it like this...

case Expr of
    Pat -> Expr ;
case Expr of
    Pat -> Expr ;
    Pat -> Expr end.

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.

I can appreciate Richard's "unique" formatting style. Unfortunately,
optional preceding ";" is not allowed on the first  pattern.

case Expr of
   ; Pat -> Expr
or case Expr of
   ; Pat -> Expr
   ; Pat -> Expr end.


2008/12/19 Robert Virding <>

> 2008/12/19 Ulf Wiger <>
>
>> 2008/12/19 Raimo Niskanen <<raimo%>
>> >:
>> > I would like you to submit comments regarding EEP-25 on the
>> >  mailing list.
>>
>> I for one find it acceptable. The "; or case" construct is ok -
>> perhaps not extremely elegant, but conveys the meaning
>> very well.
>>
>
> Note that "; or case" is Richard's O'Keefe's way of writing it, "normally"
> it would look like:
>
> case Expr of
>     Pat -> Expr ;
>     or case Expr of
>     Pat -> Expr ;
>     Pat -> Expr ;
>     or case ...
>
> Richard prefers using the separators as a form of keyword. You probably
> don't need the extra 'or' though it might make it clearer.
>
> As an alternative suggestion is to have cond but to extend the test to have
> a boolena match:
>
> cond
>     test1() -> ... ;
>     Pat = expr() -> ... ;
>     ...
> end
>
> and allow guards. It wouldn't be as versatile as the suggestion in the EEP.
>
> Robert
>
>
> _______________________________________________
> eeps mailing list
> 
> http://www.erlang.org/mailman/listinfo/eeps
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/eeps/attachments/20081219/4fae6b35/attachment.html>


More information about the eeps mailing list