Skip to content

Commit 9483fe6

Browse files
VicKristofferC
authored andcommitted
Created an actual table [Manual,Scope of Variables] (#29789)
(cherry picked from commit 679c5b5)
1 parent 93e79fc commit 9483fe6

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

doc/src/manual/variables-and-scoping.md

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,16 @@ set of source lines; instead, it will always line up with one of these blocks. T
1313
main types of scopes in Julia, *global scope* and *local scope*. The latter can be nested. The
1414
constructs introducing scope blocks are:
1515

16-
# [](@id man-scope-table)
17-
18-
* Scope blocks that may nest only in other global scope blocks:
19-
20-
- global scope
21-
22-
+ [`module`](@ref), [`baremodule`](@ref)
23-
24-
+ at interactive prompt (REPL)
25-
26-
- local scope (don't allow nesting)
27-
28-
+ (mutable) [`struct`](@ref), [`macro`](@ref)
29-
30-
* Scope blocks which may nest anywhere (in global or local scope):
31-
32-
- local scope
33-
34-
+ [`for`](@ref), [`while`](@ref), [`try-catch-finally`](@ref try), [`let`](@ref)
35-
36-
+ functions (either syntax, anonymous & do-blocks)
37-
38-
+ comprehensions, broadcast-fusing
16+
### [Scope constructs](@id man-scope-table)
17+
18+
Construct | Scope type | Scope blocks it may be nested in
19+
------------ | ------------- |---------------------------
20+
[`module`](@ref), [`baremodule`](@ref) | global | global
21+
interactive prompt (REPL) | global | global
22+
(mutable) [`struct`](@ref), [`macro`](@ref) | local | global
23+
[`for`](@ref), [`while`](@ref), [`try-catch-finally`](@ref try), [`let`](@ref) |local | global or local
24+
functions (either syntax, anonymous & do-blocks) | local | global or local
25+
comprehensions, broadcast-fusing | local | global or local
3926

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

0 commit comments

Comments
 (0)