Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docstrings for Base, Core, Main, Module #31131

Merged
merged 4 commits into from
Mar 3, 2019
Merged

Conversation

jw3126
Copy link
Contributor

@jw3126 jw3126 commented Feb 21, 2019

Towards #26919

@kshyatt kshyatt added the docs This change adds or pertains to documentation label Feb 23, 2019
@kshyatt kshyatt requested a review from fredrikekre February 23, 2019 07:23

The base library of Julia. `Base` is a module that contains basic functionality (the contents of `base/`). All modules implicitly contain `using Base`, since this is needed in the vast majority of cases.
"""
kw"Base"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why these would be handled like keywords. Can we attach the doc strings to the modules themselves instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that kw"Base" was introduced before this PR. I guess maybe for some kind of bootstrap reason? Anyway in case of Main and Core I needed to do this in order to make e.g.

help?> Core

work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I get, if I remove kw:

help?> Base
search: Base basename AbstractSet Broadcast broadcast broadcast! AbstractString AbstractDisplay set_zero_subnormals get_zero_subnormals

  No documentation found.

  No docstring found for module Base.

help?> Main
search: Main DomainError maxintfloat SegmentationFault maximum maximum! Matrix BitMatrix mapslices DenseMatrix timedwait StridedMatrix

  No documentation found.

  No docstring found for module Main.

help?> Core
search: Core isconcretetype searchsorted searchsortedlast searchsortedfirst code_lowered @code_lowered StackOverflowError code_warntype

  No documentation found.

  No docstring found for module Core.

help?> Main.Core
  No documentation found.

  No docstring found for module Core.

help?> Core.Main
  Main

  Main is the top-level module, and Julia starts with Main set as the current module. Variables defined at the prompt go in Main, and
  varinfo lists variables in Main.

  julia> @__MODULE__
  Main

help?> Main.Base
  No documentation found.

  No docstring found for module Base.

help?> Base
search: Base basename AbstractSet Broadcast broadcast broadcast! AbstractString AbstractDisplay set_zero_subnormals get_zero_subnormals

  No documentation found.

  No docstring found for module Base.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It seems to work if you document a module's "self binding", i.e. Base.Base, Core.Core, and Core.Main.Main.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, it works!

doc/src/manual/modules.md Outdated Show resolved Hide resolved
doc/src/manual/modules.md Outdated Show resolved Hide resolved
@StefanKarpinski
Copy link
Member

Looks good to me. @fredrikekre: looks like all your requested changes have been resolved. Please merge if you're good with this now.

@fredrikekre fredrikekre merged commit 9cb2305 into JuliaLang:master Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants