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

Håkan Mattsson hakan@REDACTED
Wed Jan 6 16:08:44 CET 2010


2010/1/6 Lövei László <lovei@REDACTED>:
> Zoltan Lajos Kis wrote:
>>
>> I understand that they are ordinary variables. But I am certain that all
>> the _Var variables I have seen so far were named so in order to indicate
>> that they are intentionally unused, and not because of some strange naming
>> habit.
>
> It is also useful in generated code, take a look at the output of yecc for
> an example.

For generated code, I think that it makes sense to switch off the
compiler warning
for unused variables.

I second the idea of introducing a new warning for the use of
variables beginning
with underscore. It is quite easy to make unintentional use of such variables.

/Håkan


More information about the erlang-questions mailing list