[erlang-questions] how: Getting -export_type information at run time?
Fri Apr 10 11:36:40 CEST 2015
On Fri, Apr 10, 2015 at 10:25 AM, Bengt Kleberg <>
> When I use beam_lib:chunks/2 I get tuples that are easy to identity as
> type information(*).
> When I turn the chunks into an abstract tree I do not understand how to
> find the type info any more. How should a fun for erl_syntax_lib:fold/3
> look, to identify the type information nodes?
I haven't used that myself, so I don't really know, but if you get tuples
that you can use directly, maybe you don't need to call fold.
> On 04/10/2015 08:41 AM, Vlad Dumitrescu wrote:
> Hi Bengt,
> You have to extract this information from beam_lib:chunks(BEAM,
> [abstract_code]) by means of erl_syntax_lib:fold/3 to keep only the
> typespecs. It would be nice to have a higher-level library that gives
> access to these internals.
> On Fri, Apr 10, 2015 at 8:23 AM, Bengt Kleberg <
> > wrote:
>> How do I find type information at run time?
>> A very nice Erlang module takes an options list. The options are -type
>> defined and -export_type'ed.
>> How do another module get that information during run time?
>> I thought that it might be in very_nice:module_info(attributes), but no
>> erlang-questions mailing list
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions