Message Boards Message Boards

GROUPS:

New symbols are unintentionally generated when using Manipulate

Posted 1 month ago
338 Views
|
1 Reply
|
0 Total Likes
|

When I open a new Mathematica session, the symbol x doesn't appear in the list of symbols in the Global context.

Now I run the following command in this notebook:

Manipulate[x, {x, 1, 2, 1}]

and now x indeed appears in the list of symbols:

Names["Global`*"]

as one can check:

MemberQ[ Names["Global`*"] ,  "x" ]
(* True *)

And together with x the symbol x$$ appears there too.

Why is that? What is this x with the double dollar sign? Should I be worried about these two xs?

EDIT:

Table[t, {t, 0, 2}]

adds t into the Global symbols list, too. But t$$ is not there, for some reason.

Posted 1 month ago

Manipulate, Module, DynamicModule create unique symbol names to avoid collision with names in the outer scope. Module uses Unique, not sure what DynamicModule uses.

Module[{x}, x]

DynamicModule[{x}, x]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract