[erlang-questions] module_info

Bengt Kleberg bengt.kleberg@REDACTED
Sat May 19 17:11:08 CEST 2007


On 2007-05-19 16:27, Saifi Khan wrote:
> Hi:
> 
> Started working through the 'Getting started with Erlang' examples.
> 
> There are two module_info functions that seem to be defined
> for every module.
>  module_info/0  
>  module_info/1
> 
> What is the purpose of module_info function ?

they give you information about the module (from the compiler).


> On invocation the following info is shown for example
> 2> tut:module_info().
> [{exports,[{double,1},{module_info,0},{module_info,1}]},
>  {imports,[]},
>  {attributes,[{vsn,[273405249567272843094678604656701543356]}]},
...deleted
> 
> What is the interpretation of the vsn entry in the attributes field ?
if you have an entry like this:
-vsn('1.0.0').
in your module, this value will be available from module_info().
otherwise the compiler creates a value.


bengt
-- 
Those were the days...
    EPO guidelines 1978: "If the contribution to the known art resides
    solely in a computer program then the subject matter is not
    patentable in whatever manner it may be presented in the claims."



More information about the erlang-questions mailing list