couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <>
Subject Re: [DISCUSS] Erlang whitespace standards (was: [POLL])
Date Fri, 04 Apr 2014 20:25:49 GMT
On Sat, Apr 5, 2014 at 12:16 AM, Joan Touzet <> wrote:
> Thus spake Alexander Shorin:
>> I just faced another indention case which left out of scope of the vote:
>> Personally, I'm for 1) variant there.
> Considering the Z*Y=X approach and the case statement proposal,
> and also
> which has the official guideline, I would say 3) is probably the best
> mapping, wouldn't you?

Imho, 3) looks ugly with = in line without anything on the right side.
While in this case receive block looks more better, it creates
conflict with anonymous functions and cases, where you can do the same
kind of formatting. However, we'd already defined another style for
that: fun and case on the same line as assignment. Different rules for
different blocks or there are many ways to format the same things -
which issue to pick?

Btw. Erlang plugin for IDEA formats this case as variant 4).

>> Another interesting case is anonymous function:
>> I prefer 3) one.
> Paul showed an anonymous function example in the follow-up I sent,
> see :
> but it does not cover multiple guarded variants. 3) seems reasonable
> to me but I defer to others....

For single guard Paul's example is the best, but that's why I raised
the question: for multiple guards it's not very readable.


View raw message