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

Recommend a workflow for methodswith in the REPL #46746

Closed
wants to merge 3 commits into from
Closed

Recommend a workflow for methodswith in the REPL #46746

wants to merge 3 commits into from

Conversation

udohjeremiah
Copy link
Contributor

I've often seen first timers coming from OOP language and then they complain about having to break their workflows and ask questions or google just to know a simple function to use, where in the classical OOP-style, all they needed was an IDE and a dot syntax to list all available methods.

My point is, anything that can help with stuffs like this should be documented in a simple way. My first time using Julia, I certainly didn't wanted the methodswith function, because it broke the whole REPL and won't even show the first 100 functions if the methods is more than 700.

Until recently I started using the workflow I recommended in this patch. So it will be nice if something of that nature is done and then point users to it to keep their workflow stable, ALL IN THE REPL.

@udohjeremiah udohjeremiah added the docs This change adds or pertains to documentation label Sep 13, 2022
@KristofferC
Copy link
Member

KristofferC commented Sep 16, 2022

This seems like a strange place to put basic information on how to store objects to variables or how to index arrays etc.

But also see #38791.

julia>  ?("foo", "bar")<TAB>
*(s1::Union{AbstractChar, AbstractString}, ss::Union{AbstractChar, AbstractString}...) in Base at strings/basic.jl:260
(::Colon)(start::T, stop::T) where T in Base at range.jl:7
==(a::String, b::String) in Base at strings/string.jl:122
CanonicalIndexError(func::String, type) in Base at abstractarray.jl:1255
Regex(pattern::AbstractString, flags::AbstractString) in Base at regex.jl:55
abspath(a::AbstractString, b::AbstractString...) in Base.Filesystem at path.jl:439
asyncmap(f, s::AbstractString; kwargs...) in Base at asyncmap.jl:247
broadcast(f::Tf, As...) where Tf in Base.Broadcast at broadcast.jl:798
broadcast!(f::Tf, dest, As::Vararg{Any, N}) where {Tf, N} in Base.Broadcast at broadcast.jl:837
chopprefix(s::Union{SubString{String}, String}, prefix::Union{SubString{String}, String}) in Base at strings/util.jl:240
chopsuffix(s::Union{SubString{String}, String}, suffix::Union{SubString{String}, String}) in Base at strings/util.jl:282
...

@udohjeremiah
Copy link
Contributor Author

This ? works perfectly as it was designed for, but its a PAIN using it, especially when the methods are very MANY. Its not visual to the eyes.

This PR is recommending a workflow and yeah it might not be the best place to put it, but sure its a workflow.

Where do you think it should be anyways?

@LilithHafner
Copy link
Member

Perhaps this could be a section in doc/src/manual/arrays.md about how to view large arrays in the REPL. I've seen that request come up before.

@udohjeremiah
Copy link
Contributor Author

Don't know where exactly it should be in doc/src/manual/arrays.md or under what section. Maybe you should open a PR in there and then link this PR.

@andrewjradcliffe
Copy link
Contributor

I would note that for Emacs users (maybe Vim? though I know little about Vim), having the REPL dump all on methods/methodswith is excellent, as one can simply use things like swiper to fuzzy-search and find what one is looking for with a few keys.

Note that I am not trying to dismiss this PR outright, but I believe that suggesting a burdensome approach in the manual or docstrings should be avoided.

@LilithHafner
Copy link
Member

There are many good ways to view large vectors (e.g. using a text editor or ide as @andrewjradcliffe mentioned). The recommendations in this PR are workable, but I do not think they are worth recommending for all users of methods.

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.

4 participants