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

Created an actual table [Manual,Scope of Variables] #29789

Merged
merged 3 commits into from Oct 25, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 10 additions & 23 deletions doc/src/manual/variables-and-scoping.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,16 @@ set of source lines; instead, it will always line up with one of these blocks. T
main types of scopes in Julia, *global scope* and *local scope*. The latter can be nested. The
constructs introducing scope blocks are:

# [](@id man-scope-table)

* Scope blocks that may nest only in other global scope blocks:

- global scope

+ [`module`](@ref), [`baremodule`](@ref)

+ at interactive prompt (REPL)

- local scope (don't allow nesting)

+ (mutable) [`struct`](@ref), [`macro`](@ref)

* Scope blocks which may nest anywhere (in global or local scope):

- local scope

+ [`for`](@ref), [`while`](@ref), [`try-catch-finally`](@ref try), [`let`](@ref)

+ functions (either syntax, anonymous & do-blocks)

+ comprehensions, broadcast-fusing
### [Scope constructs](@id man-scope-table)

Construct | Scope type | Scope blocks it may be nested in
------------ | ------------- |---------------------------
[`module`](@ref), [`baremodule`](@ref) | global | other global
interactive prompt (REPL) | global | other global
(mutable) [`struct`](@ref), [`macro`](@ref) | local | other global
[`for`](@ref), [`while`](@ref), [`try-catch-finally`](@ref try), [`let`](@ref) |local | other local
functions (either syntax, anonymous & do-blocks) | local | other local
comprehensions, broadcast-fusing | local | other local
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The three last rows here should state other local or global as per the old docs I assume?

Copy link
Author

@ghost ghost Oct 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, how could I miss that :( !!
(but I knew those 3 constructs can nest in either global or local scopes).
Thanks for checking


Notably missing from this table are
[begin blocks](@ref man-compound-expressions) and [if blocks](@ref man-conditional-evaluation)
Expand Down