couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <kxe...@gmail.com>
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 <joant@atypical.net> wrote:
> Thus spake Alexander Shorin:
>> I just faced another indention case which left out of scope of the vote:
>> https://gist.github.com/kxepal/2c09fb5348ead90bea04
>>
>> Personally, I'm for 1) variant there.
>
> Considering the Z*Y=X approach and the case statement proposal,
> and also http://erlang.org/doc/reference_manual/expressions.html#id77318
> 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:
>> https://gist.github.com/kxepal/c5480209af9e93a14155
>>
>> I prefer 3) one.
>
> Paul showed an anonymous function example in the follow-up I sent,
> see :
>
> https://gist.github.com/davisp/8665dd5ca023b5da8f24#file-indent-erl-L17-L24
>
> 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.



--
,,,^..^,,,

Mime
View raw message