<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 19, 2014 at 2:33 PM, semmit mondo <span dir="ltr"><<a href="mailto:semmitmondo@freemail.hu" target="_blank">semmitmondo@freemail.hu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div> <br></div>
<div>Is it possible to figure out the spec of functions in a compiled module?</div>
<div> </div>
<div>Given a module name I want to be able to know what is the return type</div>
<div>of a function in that module and what are the types of the arguments.</div>
<div>But all I know at the moment is the arity of the function (via module_info).</div>
<div>Is that info lost when compiling? </div>
</blockquote></div><div class="gmail_extra"><br></div>If the module was compiled with debug info, then you can call beam_lib:chunks(Module, [abstract_code]) and traverse the result looking for the spec attributes. </div><div class="gmail_extra"><br></div><div class="gmail_extra">I would have expected that the specs would be listed in the 'attributes' chunk, but it looks that they aren't. Is there a reason for that?</div><div class="gmail_extra"><br></div><div class="gmail_extra">regards,</div><div class="gmail_extra">Vlad</div><div class="gmail_extra"><br></div></div>