Message Boards Message Boards

0
|
2016 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

New symbols are unintentionally generated when using Manipulate

Posted 2 years ago

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 BY: Ehud Behar
Posted 2 years 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]
POSTED BY: Rohit Namjoshi
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