<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace"><span style="font-family:arial,sans-serif">2018-04-14 21:11 GMT+02:00 John Doe </span><span dir="ltr" style="font-family:arial,sans-serif"><<a href="mailto:donpedrothird@gmail.com" target="_blank">donpedrothird@gmail.com</a>></span><span style="font-family:arial,sans-serif">:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div>I wonder why code:load_binary() requires module name as one of the arguments? The function would fail if this name is not equal to the real module name from the binary, so it can deduce the correct name. Why it does not allow loading just whatever module from a given binary and return something like {ok, moduleName} as the result?</div></div>
</blockquote></div><br></div><div class="gmail_extra"><div class="gmail_default" style="font-family:"courier new",monospace">I guess to avoid overwriting an unexpected module. The input binary can contain any code, if it pretends to be the list module, but the caller thinks its the strings module, that could be a problem.</div><br></div></div>