From f5e76202cc6e954c90f9358d8506e96ab90c27da Mon Sep 17 00:00:00 2001 From: Vic <35498248+VictorelPetrovich@users.noreply.github.com> Date: Thu, 25 Oct 2018 15:31:31 -0700 Subject: [PATCH] Created an actual table [Manual,Scope of Variables] (#29789) (cherry picked from commit 679c5b531eaf6812db3d9c7037c38c2056c7dc57) --- doc/src/manual/variables-and-scoping.md | 33 ++++++++----------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/doc/src/manual/variables-and-scoping.md b/doc/src/manual/variables-and-scoping.md index 40bed258c30d3..eae8c87bb8318 100644 --- a/doc/src/manual/variables-and-scoping.md +++ b/doc/src/manual/variables-and-scoping.md @@ -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 | global +interactive prompt (REPL) | global | global +(mutable) [`struct`](@ref), [`macro`](@ref) | local | global +[`for`](@ref), [`while`](@ref), [`try-catch-finally`](@ref try), [`let`](@ref) |local | global or local +functions (either syntax, anonymous & do-blocks) | local | global or local +comprehensions, broadcast-fusing | local | global or local Notably missing from this table are [begin blocks](@ref man-compound-expressions) and [if blocks](@ref man-conditional-evaluation)