-
Notifications
You must be signed in to change notification settings - Fork 446
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
Scope and the order of declarations/definitions. #110
Comments
Also not counting that in case of "re-definition" the last declaration wins (so in that context the order would matter), but this is somewhat beyond the scope of the "Scope" section. |
It does matter. What this means is that it matters within a scope. |
Aha, so I was a bit hurrying t close this.
That makes sense. Though the way it was originally written (stressed Assuming that section is just an introductory section of the language overview (so we don't probably want to bring all those "last declaration wins" details there with tons of ifs and whens, e.g. "for the scopes themselves the order does not matter" vs. "within a single scope the standard 'last definition of the variable is used' rule applies") - How about changing current:
to something more neutral like:
? (I.e. not mentioning any "order" stuff at all since this is described later in "Lazy Loading" linked with "See also") |
Sounds better to me |
Closing as fixed in the docs. |
(I linked to the "Scope" section from 1868, read it and...)
It states:
This is misleading. The order of declarations does not matter actually . E.g. the following two examples are equal:
(A):
(B):
Not counting a few language dark corner cases and issues similar to those mentioned in 1399 where the order of definition is indeed important (usually just involving some recursive (re)definitions and cycling dependencies)).
I decided to create this ticket first just in case someone has any/other ideas for improving/rewording this docs section.
The text was updated successfully, but these errors were encountered: