I know that we can use any module with __info__(:functions)
to get a list of public functions in that module. For example Enum.__info__(:functions)
will return a list of its public methods. But it is not printing all if them. for example Enum.to_list
is not listed in the output. Why is it so ? Is there a way to get it all printed ?
to_list/1
is in Enum.__info__(:functions)
:
iex> {:to_list, 1} in Enum.__info__(:functions)
true
If you are relying on standard inspection in iex
then it truncates long lists (marked by ...
at the end of the list). If you want full output then you need to use inspect Enum.__info__(:functions), limit: :infinity
.
BTW I believe that in recent OTP version this function should be deprecated in favour of mod.module_info/1
.
2 Likes
Thank you! this worked
inspect Enum.module_info(:functions), limit: :infinity
1 Like