<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>The problem is with list_to_existing_atom/1. Really it is a great idea. But...</div><div><br></div><div>1. I have raw query strings coming in from the cruel outside world.</div><div>2. I convert some bits of those into atoms by way of list_to_existing_atom so that someone cannot kill me with DOS attack by bloating my atom table.</div><div>3. With me so far? Good.</div><div>4. My server, an OTP app, has a .app file that lists several other apps.</div><div>5. list_to_existing_atom fails on atoms defined in those several other apps.</div><div><br></div><div>Suggestion: The documentation should specify what "exists" really means.</div><div><br></div><div>Question: What should I do to force the atoms from my dependent apps to be loaded? I've been manually calling Module:module_info/0 just in time but, alas, this is starting to fail due to other module dependencies that are unknown at my call sites.</div><div><br></div><div>For reference, here is the existing Erlang doc from the .org site:</div><div><br></div><div><a href="http://www.erlang.org/doc/man/erlang.html#list_to_existing_atom-1">http://www.erlang.org/doc/man/erlang.html#list_to_existing_atom-1</a></div><div><p><a name="list_to_existing_atom-1"><span class="bold_code">list_to_existing_atom(String) -> atom()</span></a><br></p>
<div class="REFBODY"><p>Types:</p>
<div class="REFTYPES">
<span class="bold_code">String = string()</span><br>
</div>
</div>
<div class="REFBODY"><div>
<br class="webkit-block-placeholder"></div><p>Returns the atom whose text representation is <span class="code">String</span>,
but only if there already exists such atom.</p><p>Failure: <span class="code">badarg</span> if there does not already exist an atom
whose text representation is <span class="code">String</span>.</p></div></div></body></html>