Small poll
Luke Gorrie
luke@REDACTED
Wed Dec 17 21:31:39 CET 2003
James Hague <jamesh@REDACTED> writes:
> And "a + 42" as a legitimate mistake on the programmer's part is
> much, much rarer than a simple fat-fingering of the name of a
> function in a another module and having the compiler accept it
> anyway (note: I'm not suggesting that this should be addressed!).
I guess xref addresses this.
There's also a compiler option I've been wanting that could handle
it. I would like an option to generate a M:module_info(calls) that
returns a list of calls made by each function in the module.
Returns: [{Function, Arity, [Callee]}]
Callee = {Module, Function, Arity}
This way it would be easy to write a program that loads all modules in
the code path and reports all calls to functions that can't be found.
(I must admit that I rarely have this particular problem, possibly
because I use M-TAB and M-/ to complete my function names.)
I really want it as a way to write a who_calls(M,F,A)->[{M,F,A}]
function that could be used by Emacs for a "reverse tags lookup".
who_calls would expect all relevant modules to be loaded and do a fold
over them to find all callers. Then I can present the results in a
"hyperlinked" buffer and save myself a lot of grep'ery.
I've been meaning to hack this up as a parse transform using
syntax_tools and use it in the Jungerl. But if it's something the OTP
group would be interested in, I could look at putting it in the
compiler..?
-Luke
More information about the erlang-questions
mailing list