November 2017
Beginner
316 pages
6h 40m
English
When we define functions in Julia, we may also define variables inside the function body. This way, that variable is said to be inside a function's local scope, hence, is called a local variable. On the other hand, any variable that isn't declared inside a function's body is said to be in a global scope, hence, is called a global variable.
Different blocks of code can use the same name without referring to the same entity. This is defined by the scope rules.
Julia has two main types of scopes, global scope and local scope. The local scope can be nested. Variables at module or in REPL are generally in global scope unless stated otherwise. Variables in loops, functions, macros, try-catch-finally ...
Read now
Unlock full access