MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Can one have different Coloring to show which local symbols are not used in a module?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108688] Can one have different Coloring to show which local symbols are not used in a module?
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Sat, 27 Mar 2010 05:11:37 -0500 (EST)

Hello;

Many times when I write some module, I add local symbols, then later I might 
change the code and those symbols will no longer be used.

For example

f[x_]:=Module[{a,b},...  a=...; ....]

Suppose that 'a' is still used, but 'b' is not used inside the module. Both 
will be colored green as things are now.

It would be nice, if a new color is made for symbols that are local, but NOT 
used, i.e not referenced.

This way, after some long editing session, and I need to clean the code, I 
can simply remove those local symbols declaration more easily, by remove the 
symbols with the new color.

Right now, I have to check for each symbol, one by one, by doing Find, to 
see if I am still using it or not.

In practice, I normally like to write small functions, so this is not a 
problem, as I can easily see which symbol is used or not, but sometimes, I 
have to write a large function, and I notice the need for this feature.

May be this feature can be added to version 8? (Unless one can do this now 
in version 7, which I am not aware of).

--Nasser




  • Prev by Date: Re: Mathematica starts badly 1 time over 5 in OSX
  • Next by Date: Re: Mathematica starts badly 1 time over 5 in OSX
  • Previous by thread: Re: Adding data to excel sheet (v7.0)
  • Next by thread: Re: Can one have different Coloring to show which local symbols are not used in a module?