Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

First of all I suspect you are running Mathematica 10.0.0 and are experiencing these issues:

In version 10.0.1 I get:

Names["Global`*"] 
{} 

And then:

mydummy[x_, y_, model_] := Module[{ans, j}, ans = Sum[x[[j]], {j, 1, y}]]; Names["Global`*"] 
{"ans", "ans$", "j", "j$", "model", "mydummy", "x", "y"} 

The remaining names can all be explained as expected behavior. Every Symbol name that appears that does not correspond to an existing Symbol in the $ContextPath

is created in the current $Context. See:

This explains {"ans", "j", "model", "mydummy", "x", "y"}.

The remaining two: {"ans$", "j$"} are more tricky; I believe they are created by the automatic renaming mechanism that applies to nested scoping constructs, here SetDelayed and Module. See:

I shall try to address all of your question on a point-by-point basis if I have time. I think those links should give you plenty to read for the moment, and right now it is time for me to eat. :-)

First of all I suspect you are running Mathematica 10.0.0 and are experiencing these issues:

In version 10.0.1 I get:

Names["Global`*"] 
{} 

And then:

mydummy[x_, y_, model_] := Module[{ans, j}, ans = Sum[x[[j]], {j, 1, y}]]; Names["Global`*"] 
{"ans", "ans$", "j", "j$", "model", "mydummy", "x", "y"} 

The remaining names can all be explained as expected behavior. Every Symbol name that appears that does not correspond to an existing Symbol in the $ContextPath

is created in the current $Context. See:

This explains {"ans", "j", "model", "mydummy", "x", "y"}.

The remaining two: {"ans$", "j$"} are more tricky; I believe they are created by the automatic renaming mechanism that applies to nested scoping constructs, here SetDelayed and Module. See:

I shall try to address all of your question on a point-by-point basis if I have time. I think those links should give you plenty to read for the moment, and right now it is time for me to eat. :-)

First of all I suspect you are running Mathematica 10.0.0 and are experiencing these issues:

In version 10.0.1 I get:

Names["Global`*"] 
{} 

And then:

mydummy[x_, y_, model_] := Module[{ans, j}, ans = Sum[x[[j]], {j, 1, y}]]; Names["Global`*"] 
{"ans", "ans$", "j", "j$", "model", "mydummy", "x", "y"} 

The remaining names can all be explained as expected behavior. Every Symbol name that appears that does not correspond to an existing Symbol in the $ContextPath

is created in the current $Context. See:

This explains {"ans", "j", "model", "mydummy", "x", "y"}.

The remaining two: {"ans$", "j$"} are more tricky; I believe they are created by the automatic renaming mechanism that applies to nested scoping constructs, here SetDelayed and Module. See:

I shall try to address all of your question on a point-by-point basis if I have time. I think those links should give you plenty to read for the moment, and right now it is time for me to eat. :-)

Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

First of all I suspect you are running Mathematica 10.0.0 and are experiencing these issues:

In version 10.0.1 I get:

Names["Global`*"] 
{} 

And then:

mydummy[x_, y_, model_] := Module[{ans, j}, ans = Sum[x[[j]], {j, 1, y}]]; Names["Global`*"] 
{"ans", "ans$", "j", "j$", "model", "mydummy", "x", "y"} 

The remaining names can all be explained as expected behavior. Every Symbol name that appears that does not correspond to an existing Symbol in the $ContextPath

is created in the current $Context. See:

This explains {"ans", "j", "model", "mydummy", "x", "y"}.

The remaining two: {"ans$", "j$"} are more tricky; I believe they are created by the automatic renaming mechanism that applies to nested scoping constructs, here SetDelayed and Module. See:

I shall try to address all of your question on a point-by-point basis if I have time. I think those links should give you plenty to read for the moment, and right now it is time for me to eat. :-)