Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Scope-modifiers/Mathematica/scope-modifiers.math
Normal file
14
Task/Scope-modifiers/Mathematica/scope-modifiers.math
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
Module -> localize names of variables (lexical scoping)
|
||||
Block -> localize values of variables (dynamic scoping)
|
||||
Module creates new symbols:
|
||||
Module[{x}, Print[x];
|
||||
Module[{x}, Print[x]]
|
||||
]
|
||||
->x$119
|
||||
->x$120
|
||||
Block localizes values only; it does not create new symbols:
|
||||
x = 7;
|
||||
Block[{x=0}, Print[x]]
|
||||
Print[x]
|
||||
->0
|
||||
->7
|
||||
Loading…
Add table
Add a link
Reference in a new issue