-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
clear/remove names from repl #2385
Comments
+1 for clutter removal functionality. R uses the |
+1 In R |
This is probably Jeff's most hated feature request. |
Maybe so, but users expect it. Making restarts fast is another possibility. |
Related to this: #482 |
I'd much rather have faster restarts. |
This can be related to this too: #1195 |
Thanks, I had been looking for that and forgot what it was called. |
+1 |
What is the problem with this feature exactly? :-) Are there technical problems with hiding a variable, even if it's only freed at the next gc? For reference, the thread I found about this is: https://groups.google.com/forum/#!msg/julia-dev/OTISvMKcr14/6fzuHO1St78J |
cool |
Why is this closed? We still can't delete individual functions, can we? I don't want to restart the whole thing just because I mis-defined one function. |
It was fixed in 0.3 but problematic so removed before 1.0. No one reopened the issue, perhaps because there may be a more appropriate one already open? (I have not searched.) We do have |
Thanks, that's what I had been looking for |
In atom/juno is |
Can it be reopened? :) |
I'm re-opening, despite personally thinking that this is probably a bad thing to have. |
Thank you. Maybe my workflow is not suitable then. Could you please
elaborate a little bit about why you don't like it?
I mean, Julia is designed as a dynamic language with strong REPL support.
How would you avoid re-defining errors in a longer REPL session? Especially
when certain lines of code are copy pasted from examples or so?
I'm coming from Matlab and there it wasn't unusual to clear variables and
functions.
Thanks!
…On Thu, Apr 15, 2021, 01:55 Oscar Smith ***@***.***> wrote:
I'm re-opening, despite personally thinking that this is probably a bad
thing to have.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2385 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCL5FHA3QA3SHFJHDYR3BLTIYTQ5ANCNFSM4ADTLYTA>
.
|
The old strategy of "redefining" |
@KristofferC , is this still working or is that an idea how to tackle this ticket? Thanks |
It's been quite some time. Is there any way to remove variables (especially functions) from current session without having to restart the kernel? |
Now that we can activate a different module than Main, it might be possible to create a new Main module and replace the old one with the new one. It could further be possible to copy some of the old bindings over, which would allow emulating the deletion of the non-copied bindings. |
Just to add a specific use case - this is pretty brutal for jupyter notebooks. It's not uncommon to have something simple like: using Plots
x = 10
plot(...) If you wanted to change It seems like there was some opposition to adding a |
Eventually we said this should be implemented by the interactive package (eg juypter), to manage Modules and allow you to get a new one whenever and however you want, instead of providing a single behavior in Base. |
x = t->10t Also would work for your case |
Thanks for the tip about workaround syntax. Do you mind clarifying the reason you don't think this would be reasonable in base? Coming from Matlab or R, it's very handy to be able to remove specific variables from scope in REPL without needing module workarounds. |
Yeah, we are still considering if we could let Revise.jl delete variables, but currently it is a major reason Julia is fast so it is a bit tricky to change |
The thing we could do at this point is create a new Main module, make it the new active REPL module, and then throw out the old Main module. That would have the desired effect (mostly). We now have the ability to replace the active REPL module, so this might be much easier to do now than in the past. |
Right. Notably though that must be implemented in REPL / IJulia / etc. now, since they have the capability of giving the user a new module, but Julia base cannot force them to implement it |
Yes; that distinction is probably not especially clear to some readers who think of Base as "everything that comes with Julia by default". But yes, this would be a REPL feature, not a Base language feature. There would be no way to clear variables from a Julia script, for example (except to make yourself a new module and continue evaluation there). |
btw afaict abstract classes behave the same way |
This is rapidly becoming a frequently-requested feature, and there doesn't appear to be a current tracking issue for it, so this will at least give me something to point to.
I think it would be acceptable if this only works from the REPL, though others may disagree.
The text was updated successfully, but these errors were encountered: