[erlang-bugs] no documentation for module_info and get_module_info

Anthony Ramine <>
Wed Nov 27 11:27:49 CET 2013

Replied inline.

Anthony Ramine

Le 27 nov. 2013 à 10:22, Fred Youhanaie <> a écrit :

> Hi
> I came across this thread from five years ago:
> http://erlang.org/pipermail/erlang-questions/2008-October/038848.html
> Was a bug report raised? If not, I'd like to raise one please :-)
> 1. erlang:get_module_info/1 and erlang:get_module_info/2 need to be
>   documented in the ERTS manual.

Why would you put it in the public documentation when it is an implementation detail (cf. for example the comment about module_info in ops.tab [1])? Why not call M:module_info()?

> 2. The documentation for module_info/0 and module_info/1 need to clarify
>   that they will always return info for the current version of a loaded
>   module, rather than the version that is active for the caller.
> 3. Can #2 above be fixed so that it returns data related to the active
>   module, rather than the current version?

2 and 3 may be a problem in the context of calling module_info directly as a local function from the very same module. If you call foo:module_info from the module bar, it would make absolutely no sense to return anything else but the current version.

But then again, if your application depends on this, you are probably doing something really unusual.

> Many thanks
> Fred


[1] https://github.com/erlang/otp/blob/maint/erts/emulator/beam/ops.tab#L35-L39

More information about the erlang-bugs mailing list