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: overhaul of "Scope" manual section #12146

Merged
merged 2 commits into from
Feb 1, 2016

Conversation

mauro3
Copy link
Contributor

@mauro3 mauro3 commented Jul 14, 2015

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:

  • description of let could use some love. In particular it is not quite clear what the difference is between introducing variables in its head vs. body.
  • macros could probably do with an example and a link to the somewhat related topic of hygiene
  • section on "Constants" seems a bit out of place. But where to move it?
  • running the doctests I got lots of errors from everywhere. Is that expected because on my path is Julia-0.3? Or are they indeed broken?
  • some description/link for scope in parallel programs (edit: added)

Cc'ing people from the issues and some of the original authors: @elextr , @uvtc, @JeffBezanson, @Sisyphuss, @nolta

(edited)

@tkelman tkelman added the docs This change adds or pertains to documentation label Jul 14, 2015
@mauro3
Copy link
Contributor Author

mauro3 commented Jul 16, 2015

Some updates after a julia-user conversation: https://groups.google.com/d/msg/julia-users/R9eVLw1PBj0/87ZrVib_dhoJ

@mauro3
Copy link
Contributor Author

mauro3 commented Sep 19, 2015

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).

@mauro3
Copy link
Contributor Author

mauro3 commented Jan 5, 2016

Ping.

@StefanKarpinski
Copy link
Member

@JeffBezanson, I know you're busy with the function overhaul, but you really need to review this.

@mauro3
Copy link
Contributor Author

mauro3 commented Jan 8, 2016

The function overhaul is more important but afterwards some time would be good.

@mauro3
Copy link
Contributor Author

mauro3 commented Feb 1, 2016

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::

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

@StefanKarpinski
Copy link
Member

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.

StefanKarpinski added a commit that referenced this pull request Feb 1, 2016
RFC: overhaul of "Scope" manual section
@StefanKarpinski StefanKarpinski merged commit 336f3e8 into JuliaLang:master Feb 1, 2016
@mauro3
Copy link
Contributor Author

mauro3 commented Feb 1, 2016

Cheers!

@simonbyrne
Copy link
Contributor

the buildbots are failing: there appears to have been some trailing whitespace in there

@StefanKarpinski
Copy link
Member

Weird. It was all green when I hit merge.

@tkelman
Copy link
Contributor

tkelman commented Feb 1, 2016

dangers of ci skip, reason not to use it

@mauro3
Copy link
Contributor Author

mauro3 commented Feb 1, 2016

Yes, whitespace, sorry!

@mauro3
Copy link
Contributor Author

mauro3 commented Feb 1, 2016

PR #14899 should have it fixed + the two typos mentioned above.

@Sisyphuss
Copy link

@tkelman if ci skip is dangerous, how about av skip?

@tkelman
Copy link
Contributor

tkelman commented Feb 2, 2016

If you're only touching docs, then [av skip] is safer, the whitespace check will still run on travis

@mauro3
Copy link
Contributor Author

mauro3 commented Feb 2, 2016

Should this be backported to 0.4?

@mauro3 mauro3 mentioned this pull request Feb 2, 2016
4 tasks
tkelman pushed a commit to tkelman/julia that referenced this pull request Mar 7, 2016
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.

9 participants