Questions tagged [scoping]
Questions on Mathematica's scoping constructs (Block, Module, With, etc.)
589 questions
1 vote
4 answers
253 views
`With` with auto-generated local variables
The strange goal I want to do something like this ...
2 votes
2 answers
226 views
Plot with local variables in Module[]: module or no module?
I need to draw sth using Plot (example below). I prefer using local variables in Module so that variables don't interfere others ...
0 votes
1 answer
130 views
Why did my output take so many images and still look strange? [closed]
This is my code: ...
3 votes
2 answers
206 views
Unexpected behaviour of Module and/or DynamicModule
The following two functions are identical, apart from the fact that the first one uses Module and the second oneDynamicModule. <...
5 votes
2 answers
400 views
Local indexed variables in With
I need to use local indexed variables inside With but it is not allowed, the same for Block and ...
3 votes
0 answers
68 views
Help understanding why Module variables (e.g. esoteric) sometimes persist as scoped (esoteric$) in the name space, and sometimes not
This part will print the change: nomos = Names["Global`*"]; Print @ Complement[Names["Global`*"],nomos]; And in between you can run one of ...
0 votes
1 answer
135 views
Symbol in Global Context but List in Module and Block? [duplicate]
Can someone explain the principles underlying the following behavior. I define the list testD, and then use a Do loop to change values in the list (I realize there are smarter ways but they don't fit ...
2 votes
1 answer
155 views
Evaluate section in a loop
I would like to evaluate a section several times for different values of some variables. I can evaluate it once with a simple command, but not in a loop. To evaluate it only once, this code works <...