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

?Symbol help message gives info on constructor, not on type #28647

Closed
matbesancon opened this issue Aug 14, 2018 · 6 comments
Closed

?Symbol help message gives info on constructor, not on type #28647

matbesancon opened this issue Aug 14, 2018 · 6 comments
Labels
docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia

Comments

@matbesancon
Copy link
Contributor

Looking up help on a type should first explain what the type is and does before going into how to call the constructor. This is not the case for Symbol

?Symbol
  Symbol(x...) -> Symbol

  Create a Symbol by concatenating the string representations of the arguments
  together.
@fredrikekre fredrikekre added docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia labels Aug 14, 2018
@fredrikekre
Copy link
Member

The fix here is to add a docstring to the Symbol type.

@matbesancon
Copy link
Contributor Author

We can't have docstrings for both type and constructor right? So it needs to be moved from Symbol(string) and edited

@fredrikekre
Copy link
Member

We can't have docstrings for both type and constructor right?

Why not?

julia> struct Foo x end

julia> """
           Foo

       The type.
       """
       Foo
Foo

julia> """
           Foo(x)

       The constructor.
       """
       Foo(x)
Foo

help?> Foo

  Foo

  The type.

  ─────────────────────────────────────────────────────────────────────
  Foo(x)

  The constructor.

@matbesancon
Copy link
Contributor Author

matbesancon commented Aug 17, 2018 via email

@nikunj-taneja
Copy link

I would like to contribute. How can I add the docstring?

@matbesancon
Copy link
Contributor Author

The doc for Symbol is in base/docs/basedocs.jl line 1251

nikunj-taneja added a commit to nikunj-taneja/julia that referenced this issue Jan 7, 2019
Added an additional docstring for the Symbol type to resolve issue to resolve Issue JuliaLang#28647
Now, ?Symbol will first display the type and then the constructor.
JeffBezanson added a commit that referenced this issue Jan 17, 2019
KristofferC pushed a commit that referenced this issue Feb 11, 2019
@KristofferC KristofferC mentioned this issue Feb 11, 2019
39 tasks
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 good first issue Indicates a good issue for first-time contributors to Julia
Projects
None yet
Development

No branches or pull requests

3 participants