<html><body><span style="font-family:Verdana; color:#000; font-size:10pt;"><div>I use the "standard" elvis rules for checking my code and I'm getting an error I'd like to understand the reasoning behind the rule. The error I'm receiving is:</div><divre class="output" style="padding-left: 30px;" mce_style="padding-left: 30px;"><span class="pre"><span class="white"><span class="brwhite">invalid_dynamic_call</span>
<span class="brwhite"> - Remove the dynamic function call on line 47. Only modules that define callbacks should make dynamic calls</span></span></span></pre><p>The line in question is </div><div style="padding-left: 30px;">Svr:stop(),<br></div><div>so the module is variable which is bound to an atom from a list in a state map (ie the servers to which a message should be sent, in this particular case it's a stop message).</div><div><br></div><div>My first question is what is the reasoning behind the elvis rule (ie what's wrong with dynamic calls)?</div><div><br></div><div>My followup question is what should I do instead? Note that making a function head for every potential choice (33 at moment) is doable for this case but seems tedious and what if the number was much larger (which it will be in other parts of the simulator being built)?</div><div><br></div><div>Duncan Sparrell</div><div>sFractal Consulting LLC</div><div>iPhone, iTypo, iApologize</div></span></body></html>