[erlang-questions] Abstract Form for -type and -spec

Mariano Guerra luismarianoguerra@REDACTED
Fri Nov 5 02:18:34 CET 2010


On Tue, Oct 26, 2010 at 12:50 AM, Alisdair Sullivan
<alisdairsullivan@REDACTED> wrote:
> Is the abstract form for type and spec attributes (as returned by, for example, epp:parse_file/3) documented anywhere? What meaning does the list in the third position in -type specs have? Is it ever not an empty list?

this type:

-type ordset(X)  :: [X].

generates this ast:

{attribute,3,type,{ordset,{type,3,list,[{var,3,'X'}]},[{var,3,'X'}]}}

that was the only type I could find in more than 600 type declarations
taken from erlang otp:

https://github.com/marianoguerra/efene/blob/master/test/files/type/all_types.erl

hope that helps


More information about the erlang-questions mailing list