What functions are visible in REPL?

I am using some people’s package. I tried to look up some function in the REPL with ?. But it turned that the function could not be found.

The function is definitely there in the package.

Is it because the function is not exported?

You can access unexported names by qualifying them with the package name:

julia> using XLSX

help?> writetable
search:

Couldn't find writetable

help?> XLSX.writetable
  writetable(filename, table; [overwrite], [sheetname])

  Write Tables.jl table to the specified filename.

This is true for both the help and using the functions.

3 Likes

Follow up question: is there a command that prints all exported items for a given module/package?

help?> names
search: names fieldnames propertynames nameof NamedTuple @NamedTuple dirname var"name" tempname fullname basename fieldname gethostname

  names(x::Module; all::Bool = false, imported::Bool = false)

  Get an array of the names exported by a Module, excluding deprecated names. If all is true, then the list also includes non-exported names defined in the module, deprecated names, and compiler-generated names. If imported is true, then names explicitly imported from other
  modules are also included.

  As a special case, all names defined in Main are considered "exported", since it is not idiomatic to explicitly export names from Main.

  See also: @locals, @__MODULE__.
5 Likes