Is there any introspective magic that would give me a list of functions defined in a module?
module Foo
function foo()
"foo"
end
function bar()
"bar"
end
end
Some mythical function like:
functions_in(Foo)
Which would return: [foo,bar]
The problem here is that both
names
andwhos
list exported names from a module. If you wanted to see them then you would need to do something like this:At this point both
names
andwhos
would list everything.If you happen to be working at the REPL and for whatever reason did not want to export any names, you could inspect the contents of a module interactively by typing
Foo.[TAB]
. See an example from this session:Somehow the tab completion is looking up un-exported names, so there must be a way to get Julia to tell them to you. I just don't know what that function is.
EDIT
I did a little digging. The un-exported function
Base.REPLCompletions.completions
seems to work, as demonstrated in a continuation of the REPL session we were previously using: