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

RFC: Make )x call methods(x) at repl #4357

Closed
wants to merge 1 commit into from

Conversation

simonster
Copy link
Member

I find myself typing methods a lot after #4344, but I see the argument for the new behavior, especially in non-command-line environments. This PR makes ) a shortcut for methods in the REPL, just as ? is a shortcut for help.

I have no particular affinity for ). I chose it because it should always be invalid at the start of a block of code and it bears some relationship to a function call.

Over the long term we will want to make sure that all forms of all methods in Base are documented and improve the help mechanism so that packages can tie into it (e.g. as in #1619), at which point this shortcut shouldn't really be necessary. But since this is just repl syntax it shouldn't break anything if we deprecate/remove it at a later date.

@stevengj
Copy link
Member

I have to say I find )foo a little weird. How about ??foo?

In IJulia, typing foo( and then tab will bring up methods(foo) in a pop-up.

@StefanKarpinski
Copy link
Member

I agree that this is a bit weird as a syntax. I'd rather make ?foo a special syntax for help and maybe include a full methods list in it. This is a lot less of an issue in IJulia since there's automatic method listing when you've typed foo( there's no reason we can't implement that kind of tab completion in our REPL, which would make this issue to away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants