[erlang-questions] metaprogramming with -spec

Michael Truog mjtruog@REDACTED
Fri Sep 19 16:57:28 CEST 2014


That link is a bit old.  The code is here https://gist.github.com/okeuday/76724b20dca62c27420f

On 09/19/2014 05:56 AM, Vlad Dumitrescu wrote:
> See also http://erlang.org/pipermail/erlang-questions/2011-March/056896.html
>
>
> On Fri, Sep 19, 2014 at 2:52 PM, Vlad Dumitrescu <vladdu55@REDACTED <mailto:vladdu55@REDACTED>> wrote:
>
>     On Fri, Sep 19, 2014 at 2:33 PM, semmit mondo <semmitmondo@REDACTED <mailto:semmitmondo@REDACTED>> wrote:
>
>
>         Is it possible to figure out the spec of functions in a compiled module?
>         Given a module name I want to be able to know what is the return type
>         of a function in that module and what are the types of the arguments.
>         But all I know at the moment is the arity of the function (via module_info).
>         Is that info lost when compiling?
>
>
>     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.
>
>     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?
>
>     regards,
>     Vlad
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140919/1a30d809/attachment.htm>


More information about the erlang-questions mailing list