[erlang-questions] leading underscores on variables versus _

Matthias Lang <>
Fri Feb 2 16:55:46 CET 2007


Ulf Wiger (TN/EAB) writes:

 > Matthias Lang
 > >   f(_x, _x) -> same;
 > >   f(_,_) -> different.

 > A bit more seriously, consider the following code from
 > erl_parse.erl:
 > 
 > yeccpars2(6, ';', __Ss, __Stack, __T, __Ts, __Tzr) ->
 >  yeccpars1(__Ts, __Tzr, 282, [6 | __Ss], [__T | __Stack]);

I'd classify this as much less serious, since it wouldn't even compile
(if writing __Stack was the same as writing _). Not compiling is a
minor problem. Compiling and then acting differently to before is a
major problem.

Matthias



More information about the erlang-questions mailing list