-
-
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
RFC: overhaul of "Scope" manual section #12146
Conversation
Some updates after a julia-user conversation: https://groups.google.com/d/msg/julia-users/R9eVLw1PBj0/87ZrVib_dhoJ |
Now that most of the 0.4 frenzy is over, maybe this can be reviewed now? Also, if good this should be back-ported to 0.4 (and 0.3 if that is still the done thing). |
Ping. |
@JeffBezanson, I know you're busy with the function overhaul, but you really need to review this. |
The function overhaul is more important but afterwards some time would be good. |
Ping! Maybe now would be an opportune moment to review? |
@@ -315,7 +473,7 @@ similar to ``while`` loops with ``let`` blocks inside:: | |||
julia> Fs[2]() | |||
2 | |||
|
|||
``for`` loops will reuse existing variables for iteration:: | |||
``for`` loops will reuse existing variables for its iteration variable:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be: variable(s)
? you can have a for loop with multiple iteration variables, i.e.
for i=1:1000, j=1:20
Merging since this hasn't been reviewed in the 6 months since it was opened and it's more correct than what we have now. |
RFC: overhaul of "Scope" manual section
Cheers! |
the buildbots are failing: there appears to have been some trailing whitespace in there |
Weird. It was all green when I hit merge. |
dangers of ci skip, reason not to use it |
Yes, whitespace, sorry! |
PR #14899 should have it fixed + the two typos mentioned above. |
@tkelman if |
If you're only touching docs, then |
Should this be backported to 0.4? |
(cherry picked from commit 41911d9) ref JuliaLang#12146
Trying to fix issues #9469 and #9955, this turned into quite a substantial re-write of the "Scope" section of the manual. I hope this is ok, please give feedback. I do think that documenting global scope is addressed (#9469), as is the difference between soft and hard local scope (#9955), and the whole section maybe a bit more logically structured now. A semi rendered version is here.
Question: is the statement about
global
never having any effect in soft local scopes correct?I'm not 100% happy with a few things but I ran out of time & steam (and expertise) to address them. If you got quick fixes then let me know, otherwise they might be left for another day. "Issues" left:
let
could use some love. In particular it is not quite clear what the difference is between introducing variables in its head vs. body.Cc'ing people from the issues and some of the original authors: @elextr , @uvtc, @JeffBezanson, @Sisyphuss, @nolta
(edited)