[erlang-questions] Fwd: [erlang-bugs] Incorrect scope for a variable

Attila Rajmund Nohl attila.r.nohl@REDACTED
Fri Feb 18 13:03:47 CET 2011


Hello!

See this example:

case foo() of
    x -> bar(),
        SomeLongVariableName=12;
    _Else -> baz(),
        SomeLongVariableName=13
end,

That's 6 lines and 2 indentations.

SomeLongVariableName =
    case foo() of
        x -> bar(),
            12;
        _Else -> baz(),
            13
    end,

This is 7 lines, 3 indentations, plus strange looking constant numbers
on their own in a line. If two cases are nested, this latter style
quickly goes out of the bounds at the right side of the window...
Still, it's better then the first.

2011/2/18, nox <n.oxyde@REDACTED>:
> I don't understand why would you find it more compact. Can't you just bind
> case result?


More information about the erlang-questions mailing list