Skip to content

Wanted: a good way to expose the intended user interface #38162

@timholy

Description

@timholy

As Julia nears perfection :half-serious-wink:, I have the sense that discoverability remains one of the laggards. This is basically a cross-post from https://discourse.julialang.org/t/exploring-package-contents/48937. A brief summary of the highlights:

  • names(SomePkg) works pretty well when the entire intended interface is exported
  • names(CSV) is basically useless for a package like CSV where the "public" API requires module scoping. (For the record, I applaud that decision by the CSV developers.) names(CSV, all=true) is less than ideal because there is no mechanism to distinguish internal methods from ones intended for user consumption, and also delivers types, constants, and other things that may not be of interest
  • methods(CSV) yields nothing
  • apropos(CSV) is quite useful, if the module name appears in the docstring. Conversely, if the module name appears in docstrings not intended for public usage (see next item) you can get false-positives.
  • reaching in to Base.Docs.meta(CSV) is also revealing. But many of us add docstrings to internal methods to help ourselves and other developers understand the internal logic of a complicated package. So just having a docstring is not quite the same thing as being part of the user interface. This also fails for packages that mostly re-export other packages. Compare ?Images with Base.Docs.meta(Images) to see the dramatic difference this can make.

One thought might be to add

module CSV

export PooledString

export scoped=true File, Rows, read, write

...

end

It's not really exported, but it is marked as "elevated" and perhaps that marker could be used by other tools.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions