[erlang-questions] I need to call unexported functions from the erlang shell
Mon Jun 18 13:33:20 CEST 2007
> It preserves the distinction between functions which are meant
> to be called by other modules and those which are not. With
> -export_all, everything is exported on an equal footing and you
> can accidentally call a debugging function as if it were part
> of the normal interface.
On the other hand, it is already quite frequent to export
functions but leave them undocumented in the public API, thereby
indicating that they are not meant for general use. People wanting
to be able to call any function could just export_all and use docs,
unit tests or naming conventions to indicate which functions are
in the API.
> One important aspect of my proposal was -preserve, not just
> preserve_all; making it possible to expose *some* not-normally-
> exported functions for debugging purposes without requiring
> *all* of the functions to be available.
It seems to me that if the people asking for this feature knew
beforehand which functions they might need to call in a crisis,
they could design the system in such a way that there was an
appropriate official API to do what they need.
More information about the erlang-questions