Re: Why does Manipulate leak global symbols? (Potential bug here?)
- To: mathgroup at smc.vnet.net
- Subject: [mg123888] Re: Why does Manipulate leak global symbols? (Potential bug here?)
- From: David Reiss <dbreiss at gmail.com>
- Date: Wed, 28 Dec 2011 05:16:40 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jd71p5$140$1@smc.vnet.net>
This is presumably a bug in that what otherwise should be System context (or some other Context) symbols are being placed into the Global Context when they are being defined at the first instance of the use of a Manipulate. One also comes across this as one uses Mathematica -- not all symbols have been properly contextified: given how many symbols exist, it's amazing that it doesn't happen more often. --David On Dec 25, 6:35 am, Bill Rowe <readn... at sbcglobal.net> wrote: > On 12/24/11 at 7:08 AM, szhor... at gmail.com (Szabolcs) wrote: > > >It appears that in Mathematica 8, using Manipulate will create some > >symbols in the global context. Let me illustrate: > >First, I use this to monitor the contents of Global` in real time: > >Dynamic@Refresh[Sort@Names["Global`*"], UpdateInterval -> 2] > >Then I evaluate Manipulate[n, {n, 1, 10}] > >Note that the following unexpected symbols have been added to the > >Global` context: BitDepth, FullScreenArea, Resolution, ScreenArea > > >Why does this happen? Is it a bug? Can it cause any problems (e.g. > >if I have defined BitDepth before using Manipulate, in the belief > >that there's no such builtin)? > > I can't answer as to why this happens. But I doubt that it is a > bug and it seems to have no conflict with things you define. > That is, if I first do > > BitDepth=2; > > then execute the code you posted in a fresh session, the value I > assigned to BitDepth is unchanged. Alternatively, if I start a > fresh session, execute the code above then type BitDepth in a > new cell, I see BitDepth is colored consistent as any undefined > symbol would be. > > >This makes me feel a bit insecure. I am not sure if I might > >inadvertently break something by defining those symbols, thinking > >that they're not used by Mathematica (since they're syntax-coloured > >blue). > > It seems the best way to ensure no conflicts could occur is to > simply use a lower case letter as the first letter of the name > of anything you create.