I am adding a Module
inside DynamicModule
here is an example (thanks to @rm-rf for this simple example)
DynamicModule[{x = 1}, Module[{x}, x = 2] ];
This Module has a local symbol x
which happens also to be the name of another local symbol in the enclosing DynamicModule
.
Yet, the front end is making all occurrences of x
as red inside the Module
. Here is a screenshot:
The question is: Why would local symbols to one Module
conflict with local symbols of the enclosing DynamcModule
? Yet, the code runs with no problem. So, could this just be that the FE` is confused? Or am I doing something wrong?
DynamicModule[{x = 1}, Module[{x}, x = 2] ];
$\endgroup$DynamicModule[{x}, {x, Module[{x}, x]}]
to see that the variables are different. $\endgroup$DynamicModule[{x}, {x, Module[{x}, x]}]
and observe the output. $\endgroup$