Tag: scoping

234 What are the use cases for different scoping constructs? 2012-01-23T21:54:58.367

80 How to avoid nested With[]? 2012-09-11T04:09:27.633

55 How safe is the use of Block and Internal`InheritedBlock 2013-05-22T14:42:04.193

48 Local variables in Module leak into the Global context 2012-07-13T21:16:45.503

47 Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs 2013-03-06T18:28:21.163

47 What does Internal`InheritedBlock do? 2013-05-24T01:00:14.793

41 Why modules with no variables? 2012-07-12T11:12:56.007

30 What are some advanced uses for Block? 2012-10-04T21:42:56.183

30 Is the renaming mechanism of `With` flawed? 2016-06-26T11:47:07.180

29 Strange behavior with Cases and Position with SetDelayed 2015-08-19T16:20:21.327

28 What is the purpose of Internal`LocalizedBlock? 2015-01-16T17:51:09.670

28 What causes Module variables to leak? 2020-05-08T13:26:38.183

26 Module with "local functions" 2013-02-27T16:49:59.707

26 SetOptions locally? 2017-01-23T14:42:17.200

26 Bug with Block & Lookup: Scope Variable Leak 2017-12-08T17:00:25.813

24 Compile not correctly initializing a variable defined inside Module 2013-05-12T02:57:34.453

23 Nested definition: How can I define a function with a passed-in expression? 2012-08-31T09:00:44.903

21 "With" as part of the "Dynamic Interactivity Language" 2012-12-23T23:01:21.077

21 ClearAll::clloc - "Cannot clear local variable x" in Block[{x}, ...] - why? 2016-08-31T21:34:43.873

21 Bug with iterated With: Referring to function arguments invalidates previous definitions 2016-09-15T17:27:25.130

21 Should I always be using Module in functions unless I explicitly want global variables? 2016-09-21T20:27:17.940

20 Variable scope similar to other languages 2013-09-05T04:47:59.303

20 I define a variable as local to a module BUT then the module uses its global value! Why? 2015-01-29T10:50:53.153

20 Integrate - Why is the integration variable not local 2015-12-21T23:27:37.090

19 Module trash collection behaviour 2013-11-15T12:28:18.357

19 How does $CellContext` work? 2015-02-08T14:50:16.247

18 A With expression local variable specification without head List 2015-07-23T09:16:29.730

18 Internal DynamicModule steals scope of external DynamicModule 2016-05-28T17:40:48.860

17 Is the sharing of variables in Module/Block within Compile documented behavior? 2013-02-18T06:43:00.347

17 Returning a value from a Module 2014-03-23T16:53:21.403

17 Messages leak out from Block 2015-02-07T10:56:53.507

16 Modules that initialize themselves on first call 2012-10-06T16:11:39.040

16 What is the right way to construct DynamicModule 2013-08-08T11:23:36.930

16 StringReplace, ReplaceAll and Rule interact in a bizarre way 2014-04-22T21:11:53.817

16 Syntax highlighter shows error for Manipulate when it's inside a Block or a Module 2014-07-17T11:51:49.573

16 Why are delayed definitions in scoping functions NOT documented? 2016-08-03T11:44:16.610

15 Subscripts - Why do I see the error "only assignments to symbols are allowed" when using a Module and not otherwise? 2012-01-28T15:36:17.033

15 Why can't I inject expressions in Compile using (only) With 2017-08-04T11:35:57.590

14 Scoping in assigning a derivative 2012-06-11T11:09:53.433

14 Using With to scope over pure functions 2013-10-19T11:19:30.713

14 Is Mathematica's lexical scoping broken? 2016-03-08T06:52:27.113

14 Is anonymous pure function a scoping construct? 2016-08-23T08:40:29.243

14 Bug when combining Dataset with a scoping construct and Map 2016-09-02T22:09:26.633

13 Is garbage collection broken in version 10.0.0? 2014-08-28T15:58:05.657

13 Context of localised (dynamic) symbols 2015-02-18T15:36:25.227

13 Working with DynamicModule: SetDelayed + OwnValues 2016-07-27T08:17:31.570

13 Unexpected optimization with With 2016-08-09T06:19:55.320

13 RecurrenceTable iteration variable not localized? Bug or user error? 2016-09-19T13:13:54.200

12 Temporary variable not removed in Mathematica 10 2014-10-29T11:31:11.590

12 Do Table iteration variables need to be localized using Module? 2015-09-06T02:24:37.613

12 What is the equivalent of $ModuleNumber for DynamicModule 2016-03-02T11:29:11.133

12 Bug: With[] pattern-variable renaming misses symbols within `Except` 2016-08-31T20:41:05.633

12 What is the accessibility of a package's `Private` context variables? 2019-04-10T19:03:42.153

11 Localizing variables within a Manipulate 2012-11-30T20:52:34.193

11 How to correctly implement in a new function the scoping behavior of Table, Sum and other commands that use Block to localize iterators? 2016-05-23T04:06:04.033

11 Using predefined expressions as free variables in a pure function 2016-08-22T13:10:59.837

10 With/Function(/etc) replacement behaviour 2012-02-15T05:23:44.940

10 Find variable name from DumpSave on a scoped variable 2012-03-13T21:44:21.823

10 Difficulty catching thrown errors in asynchronous tasks 2012-04-01T23:02:27.303

10 Avoiding MainEvaluate in a CompiledFunction to fetch global variables 2012-06-29T10:27:15.057

10 Strange results while nesting scope constructs? 2012-08-14T01:39:52.040

10 Is it possible to use the global definition of a symbol as part of its new local definition set in a Block? 2013-06-17T23:41:43.620

10 What are the scoping rules for function parameters shadowing System` symbols? 2013-06-29T05:54:23.737

10 Compile recursive function modifying global variables 2013-08-26T19:56:46.837

10 Treat all variables as local in a module 2013-11-27T20:10:18.750

10 Working with DynamicModule: ScheduledTasks with local variables 2016-01-04T17:53:20.417

10 Memory leak with FindMaximum/Minimum inside of Module 2019-09-26T15:28:07.493

10 Proper Syntax highlighting for multi-argument With? 2020-06-11T03:00:20.947

9 How can you give a Module a context and have its local variables and Modules belong to that context? 2012-01-24T04:19:08.667

9 How to use local variables with indices in a Mathematica Block environment? 2012-04-05T15:09:27.503

9 How to define UpValues in a different context from within a package 2012-12-06T20:35:23.207

9 How to set Block local variables by code? 2013-02-18T02:00:12.057

9 How do I avoid scoping collisions of iterator variables? 2013-04-18T09:23:59.547

9 Variable scoping in Module 2014-02-15T15:53:27.933

9 A smarter nested With? 2014-11-05T13:04:18.547

9 How to assemble and disassemble a function into steps 2014-12-04T19:52:01.173

9 Import another Notebook as if it were a Package 2016-04-04T09:47:40.593

9 Where does a package have to be loaded? 2016-05-24T20:16:46.757

9 Why does the global variable exist here, where it was declared only in Module? 2016-05-28T05:47:46.560

8 Module variable scoping in Scheduled Tasks? 2012-04-01T17:19:08.360

8 Question about scoping data in a multi-level Manipulate construction 2012-04-18T16:07:05.663

8 Possible to scope an anonymous function within Module? 2013-03-14T02:58:13.887

8 FullDefinition and Module local variable 2013-06-10T20:52:27.733

8 Is it possible to write a function immune to symbol redefinitions in any Block surrounding its invocation? 2013-06-20T23:49:58.053

8 Strange behaviour of Internal`InheritedBlock 2013-10-24T21:16:37.753

8 How to reset the $ModuleNumber? 2014-01-27T00:42:13.667

8 Does the syntax coloring I see indicate a real problem? 2014-05-23T21:20:19.100

8 Cannot Block Plus 2015-08-03T16:57:00.423

8 Package functions and symbolic calculations 2016-05-10T10:10:42.853

8 Unexpected variable renaming depending on form of a pure function 2016-08-21T03:13:02.080

8 A bug in Derivative? 2018-06-18T14:33:05.730

8 Using `With[...]` with a list specification as a variable 2019-08-22T10:51:40.377

8 Local variables in sums and tables - best practices? 2020-05-04T08:00:32.170

7 Variable scoping problem when mapping over delayed replacement 2013-05-16T14:17:55.577

7 Creating a Block from a list of rules 2013-09-05T13:01:19.267

7 How to inherit options by scoping? 2014-03-02T13:05:30.273

7 How to create Functions that have Compiled functions effectively 2017-04-06T00:15:46.510

6 Exhaustive examples of variable replacement due to nested scoping constructs 2014-05-27T12:11:03.553

6 Altering values in Manipulate with dynamically generated controls 2014-10-24T11:16:09.600