MathGroup Archive 2010

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg108704] Re: Can one have different Coloring to show which local symbols are not used in a module?
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sun, 28 Mar 2010 04:07:58 -0500 (EST)

For routines in a package, the Workbench editor gives warning indications
for defined variables that are not used in a Module. But that doesn't help
in regular notebooks.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: Nasser M. Abbasi [mailto:nma at 12000.org] 

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: Adding data to excel sheet (v7.0)
  • Next by Date: Re: Managing packages in the workbench
  • Previous by thread: Re: Can one have different Coloring to show which local symbols are not used in a module?
  • Next by thread: Re: Mathematica needs better support for automatic