[erlang-questions] Compiler to warn on used underscore-variables

Tony Rogvall tony@REDACTED
Wed Jan 6 14:23:08 CET 2010


> 
> I'm simply proposing that if the compiler sees code like:
> 
> measure_secs(Fun) ->
>  {_M, S1, _U} = erlang:now(),
>  Fun(),
>  {_M, S2, _U} = erlang:now(),
>  S2 - S1.
> 
> to output something like: "Warning: variable '_U' is not unused".
> 
> Zoltan.
> 
> 
+1

Nice.
I think this could reduce the likelihood for some obscure bugs.

/Tony



More information about the erlang-questions mailing list