Tag Info

New answers tagged

8

I will make no attempt to defend the fact that Mathematica simulates scoping by means of variable renaming. However, the behaviour that we see is consistent with the principles under which Mathematica does operate. Whenever Mathematica tries to interpret a symbol name, it first checks to see whether a symbol with that name already exists in a package in ...


3

This is yet another bug caused by the Suggestions Bar. Workaround: Go to Preferences... -> Interface, and uncheck "Show Suggestions Bar after last output". I can reproduce it on OS X, Mathematica 10.0.2, but not in version 9.0.1. Whenever I see that some people can reproduce a bug, some can't, I turn on the Suggestion Bar and check if it's the ...


4

I have been thinking recently a lot about this mysterious $CellContext, that turns up when we convert a cell with interactivity (such as Button, Slider, DynamicModule, Dynamic) to a cell expression. Just as Kuba, I found that there is not much documentation on this topic, but in MathGroup and SE there are some very valuable comments and remarks, not in the ...


6

Somehow I've overlooked this topic on MathGroup earlier: $CellContext Here's what John Fultz said: $CellContext is a symbolic placeholder in cell expressions (most typically Dynamic expressions inside of Cell) which indicates that the ambient context as defined by the CellContext option should be used (which allows you to wall off notebooks, cell ...


6

My initial answer was simply wrong. I now think this is a bug. Although a message may be expressly attached to the Symbol x using TagSet it is still not localized. (TagSet is superfluous but it helps make the point.) Block[{x}, x /: x::foo = "bar"; Message[x::foo]]; Messages[x] During evaluation of In[]:= x::foo: bar {HoldPattern[x::foo] :> ...


1

Nasser is correct that the symbol name f appears to have leaked out of Module. However, I believe that this causes no harm, because it actually is a distinct symbol from that in the Module: ClearAll["Global`*"]; Remove["Global`*"]; (* Remove::rmnsm: There are no symbols matching "Global`*". >> *) Module[{f}, f[x_] := 1; {Information[f], Plot[f[x], ...



Top 50 recent answers are included