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

REPL helpmode for "=" returns error #29282

Closed
aaron-jesse-ol opened this issue Sep 20, 2018 · 5 comments · Fixed by #30754
Closed

REPL helpmode for "=" returns error #29282

aaron-jesse-ol opened this issue Sep 20, 2018 · 5 comments · Fixed by #30754
Labels
docs This change adds or pertains to documentation good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request REPL Julia's REPL (Read Eval Print Loop)

Comments

@aaron-jesse-ol
Copy link

help?> =
ERROR: LoadError: Invalid @var syntax `unexpected "="`.
Stacktrace:
 [1] splitexpr(::Any) at ./docs/bindings.jl:28
 [2] bindingexpr(::Any) at ./docs/bindings.jl:17
 [3] lookup_doc(::Expr) at /build/julia/src/julia/usr/share/julia/stdlib/v1.0/REPL/src/docview.jl:137
 [4] @doc(::LineNumberNode, ::Module, ::Expr, ::Vararg{Expr,N} where N) at ./boot.jl:451
in expression starting at /build/julia/src/julia/usr/share/julia/stdlib/v1.0/REPL/src/docview.jl:301

Looking at basedocs.jl, it seems like there isn't actually a docstring for =, so maybe parsing it isn't important. OTOH at least one user (me) has thought this would be the quick way to get answers about how = works in Julia.

Julia Version 1.0.0
Commit 5d4eaca0c9 (2018-08-08 20:58 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)
Environment:
  JULIA_EDITOR = atom -a
  JULIA_NUM_THREADS = 2
@fredrikekre fredrikekre added docs This change adds or pertains to documentation help wanted Indicates that a maintainer wants help on an issue or pull request good first issue Indicates a good issue for first-time contributors to Julia labels Sep 20, 2018
@fredrikekre
Copy link
Member

Docs for = should definitely be added.

@aaron-jesse-ol
Copy link
Author

aaron-jesse-ol commented Sep 20, 2018

Would that I were competent to do so myself. I'll just also note that it seems like the parsing issue lies with splitexpr, and the way it tries to look up a symbol using getfield(Base, :symbol), which isn't valid for a variety of more special symbols, like =, ., or @.

@fredrikekre
Copy link
Member

Right, thats why some things are documented using the kw_str string macro, for example

"""
using
`using Foo` will load the module or package `Foo` and make its [`export`](@ref)ed names
available for direct use. Names can also be used via dot syntax (e.g. `Foo.foo` to access
the name `foo`), whether they are `export`ed or not.
See the [manual section about modules](@ref modules) for details.
"""
kw"using"

So this work:

julia> import Base.BaseDocs.@kw_str

julia> """
           =

       Assignment operator.
       """
       kw"="

help?> =
search: => == === >= <= != !==

  =

  Assignment operator.

@aaron-jesse-ol
Copy link
Author

Ah, great. Then I'll at least draft a doc.

This was referenced Sep 20, 2018
@JeffBezanson JeffBezanson added the REPL Julia's REPL (Read Eval Print Loop) label Jan 11, 2019
@fredrikekre
Copy link
Member

#30745

fredrikekre added a commit that referenced this issue Jan 18, 2019
fredrikekre added a commit that referenced this issue Jan 18, 2019
fredrikekre added a commit that referenced this issue Jan 19, 2019
KristofferC pushed a commit that referenced this issue Feb 4, 2019
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506.

(cherry picked from commit b8c0ec8)
KristofferC pushed a commit that referenced this issue Feb 11, 2019
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506.

(cherry picked from commit b8c0ec8)
KristofferC pushed a commit that referenced this issue Feb 11, 2019
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506. 

(cherry picked from commit b8c0ec8)
KristofferC pushed a commit that referenced this issue Apr 20, 2019
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506.

(cherry picked from commit b8c0ec8)
KristofferC pushed a commit that referenced this issue Feb 20, 2020
…30754)

fixes #22013, fixes #24871, fixes #26933, fixes #29282,
fixes #29361, fixes #30348 and fixes #30506.

(cherry picked from commit b8c0ec8)
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 help wanted Indicates that a maintainer wants help on an issue or pull request REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants