the problem of using _Var instead of _

Matthias Lang <>
Mon Mar 7 08:26:38 CET 2005


Bengt Kleberg <> wrote:

 > 	i have operated under the assumption that _ and _<Var> are the 
 > 	same for over four years now.

As far as I can tell, the compiler treats _<Var> as "don't give any
warnings". Your problem (which has happened to me by accident a couple
of times too) would be solved if the compiler inverted the warning
behaviour compared to normal variables, i.e.:

  <Var> which appears only once in a clause: warning
  <Var> which appears multiple times in a clause: no warning

  _<Var> which appears only once in a clause: no warning
  _<Var> which appears multiple times in a clause: warning

Matthias



More information about the erlang-questions mailing list