[erlang-questions] What are the default module compiler directives?

Taavi Talvik taavi@REDACTED
Mon Oct 16 21:45:06 CEST 2006


>
> I know that there are some compiler directives like -author, -vsn etc.
> Is there an official list of these anywhere? They are not listed in
> the compiler man page.

 From Erlang reference manual:
http://www.erlang.org/doc/doc-5.5.1/doc/reference_manual/ 
modules.html#4.2

4.2 Module Attributes

A module attribute defines a certain property of a module. A module  
attribute consists of a tag and a value.

-Tag(Value).

Tag must be an atom, while Value must be a literal term.

Any module attribute can be specified. The attributes are stored in the  
compiled code and can be retrieved by using, for example, the function  
beam_lib:chunks/2.

There are several module attributes with predefined meanings, some of  
which have arity two, but user-defined module attributes must have  
arity one.

Basicly - those are generic constructions. And you are free to introduce
your own, when necessary.

best regards,
taavi




More information about the erlang-questions mailing list