convention for unused variables

Ulf Wiger (AL/EAB) <>
Thu Oct 14 11:11:41 CEST 2004


OTP R10 now warns about unused variables per default.
This is basically a Good Thing, but after having spent about two days
cleaning up modules where 99% of the work amounts to inserting a 
leading underscore in variable names that were only there for documentation's
sake, I can't help thinking that there ought to be a way to automate this
process.

The really nice option would perhaps be that the Emacs mode (or Distel)
were able to parse the warnings from the compiler, and jump to each unused
variable, allowing the programmer to change from Var to _Var with one keypress.

I would not want to do a 'replace all', since there's perhaps a 1/100 chance that
the 'unused variable' warning is actually caused by a bug (The 1/100 ratio assuming
that the programmer has _not_ used the convention with _ prefixes.)

Someone who's up to speed on Emacs Lisp could probably do this fairly quickly.
I would prefer to tackle that learning curve some other time. (-:

/Uffe



More information about the erlang-questions mailing list