<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">This looks like a great rule to add to <a href="https://github.com/inaka/elvis/">Elvis</a>.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Would you mind writing an issue for it <a href="https://github.com/inaka/elvis/issues">here</a>?</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Or if you're brave enough, we also accept Pull Requests ;)</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Cheers!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 27, 2020 at 2:22 PM Mikael Pettersson <<a href="mailto:mikpelinux@gmail.com">mikpelinux@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Since Erlang doesn't allow you to rebind a variable in a scope where it's already bound (that becomes a match instead), there is a convention of using numbered variables to denote successive "generations" of some object or state that's intended to be used in a single-threaded or linear way.  For example:<div><br></div><div>foo(X0) -></div><div>  X1 = update(X0),</div><div>  case predicate(X1) of</div><div>    true -></div><div>      X2 = another_update(X1),</div><div>      persist(X2);</div><div>    false -></div><div>     persist(X1)</div><div>  end.</div><div><br></div><div>Here, whenever X(N+1) becomes bound, X(N) should become unused, and it should be an error if X(N) did not become unused.  A variation is that the "final" value is the one without a number suffix.</div><div><br></div><div>Is there any Erlang linter or style checker that can perform these types of checks?</div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><table border="0" cellpadding="0" cellspacing="0">
    <tbody>
        <tr>
            <td align="left" valign="bottom" width="107" style="line-height:0;vertical-align:bottom;padding-right:10px;padding-top:20px;padding-bottom:20px">
                <a href="https://about.me/elbrujohalcon?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb" style="text-decoration:none" target="_blank">
                    <img src="https://thumbs.about.me/thumbnail/users/e/l/b/elbrujohalcon_emailsig.jpg?_1498084031_146" alt="" width="105" height="70" style="margin: 0px; padding: 0px; display: block; border: 1px solid rgb(238, 238, 238);">
                </a>
            </td>
            <td align="left" valign="bottom" style="line-height:1.1;vertical-align:bottom;padding-top:20px;padding-bottom:20px">
                <img src="https://about.me/t/sig?u=elbrujohalcon" width="1" height="1" style="border: 0px; margin: 0px; padding: 0px; overflow: hidden;">
                <div style="font-size:18px;font-weight:bold;color:rgb(51,51,51);font-family:"Proxima Nova",Helvetica,Arial,sans-serif">Brujo Benavides</div>
                <a href="https://about.me/elbrujohalcon?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb" style="text-decoration:none;font-size:12px;color:rgb(43,130,173);font-family:"Proxima Nova",Helvetica,Arial,sans-serif" target="_blank">about.me/elbrujohalcon
                </a>
            </td>
        </tr>
    </tbody>
</table>
</div>