Skip to main content
I edited the question into a more specific question that focuses on why.
Source Link

Why does Mathematica choose the mechanism that makes the global variable a exist without having been created here while parsing?

In

f := Module[{a}, a;]

In

?a

Out

Global`a

I don't understand why Mathematica goes in the way that the global variable a wasis declared and existsnot removed. Maybe there are its own purposes or intentions of why Mathematica is constructed in that way. Sometimes the way Mathematica works feels very confusing to me.

Thank you. :)

Why does the global variable a exist without having been created here?

In

f := Module[{a}, a;]

In

?a

Out

Global`a

I don't understand why the global variable a was declared and exists. Sometimes the way Mathematica works feels very confusing to me.

Thank you. :)

Why does Mathematica choose the mechanism that makes the global variable a here while parsing?

In

f := Module[{a}, a;]

In

?a

Out

Global`a

I don't understand why Mathematica goes in the way that the global variable a is declared and not removed. Maybe there are its own purposes or intentions of why Mathematica is constructed in that way. Sometimes the way Mathematica works feels very confusing to me.

Thank you. :)

added 3 characters in body
Source Link

Why dodoes the global variables a and bvariable a exist without having been created here?

InIn

f := Module[{a}, a;]

InIn

?a

OutOut

Global`a

I don't understand why the global variable a was declared and exists. Sometimes the way Mathematica works feels very confusing to me.

Thank you. :)

Why do the global variables a and b exist without having been created here?

In

f := Module[{a}, a;]

In

?a

Out

Global`a

I don't understand why the global variable a was declared and exists. Sometimes the way Mathematica works feels very confusing to me.

Thank you. :)

Why does the global variable a exist without having been created here?

In

f := Module[{a}, a;]

In

?a

Out

Global`a

I don't understand why the global variable a was declared and exists. Sometimes the way Mathematica works feels very confusing to me.

Thank you. :)

Tweeted twitter.com/StackMma/status/736512414242512898
edited tags
Link
added 7 characters in body
Source Link
C. E.
  • 71.2k
  • 6
  • 141
  • 269
Loading
Source Link
Loading