-
-
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
Handling of err
and ans
global variables in REPL
#43172
Comments
Yes, I think it would be reasonable to initialize them to |
Doesn't that turn the introduction of |
Could an alternative be to set a global inside the REPL module and export it only if not already in Main? |
We have changed behavior in the repl before, e.g. the scope change. Fortunately may not need to in this case.
Yes I think that works --- if you define it first, you just get your variable and the REPL modifies its own variable which you can't see. But if you request |
I made this version of the change, but I don't think I like it master...vtjnash:jn/MainInclude-ans-err In particular, it means that So possibly we want to just declare |
Or the most benign version would be to check whether |
This hides them from `names()` unfortunately, but means we will not accidentally discard a variable from the user in Main, either because the import will fail or the assignment will fail. If we later have world-versioned bindings, this would also mean you could toggle (between worlds) between being module-local and a special import value. Fix JuliaLang#43172 Fix JuliaLang#48299
This hides them from `names()` unfortunately, but means we will not accidentally discard a variable from the user in Main, either because the import will fail or the assignment will fail. If we later have world-versioned bindings, this would also mean you could toggle (between worlds) between being module-local and a special import value. This also needed some improvements to docs, so that it would print docstrings for unassigned globals without also simultaneously claiming that it did not exist. Fix JuliaLang#43172 Fix JuliaLang#48299
This hides them from `names()` unfortunately, but means we will not accidentally discard a variable from the user in Main, either because the import will fail or the assignment will fail. If we later have world-versioned bindings, this would also mean you could toggle (between worlds) between being module-local and a special import value. This also needed some improvements to docs, so that it would print docstrings for unassigned globals without also simultaneously claiming that it did not exist. Fix #43172 Fix #48299
Copying this from @mcabbott in merged #40642 to a new issue so it doesn't get lost.
===================
Is it possible that
err
, and in factans
, should have a value on startup? This would prevent this:in favour of this:
=======================
The text was updated successfully, but these errors were encountered: