lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Rici Lake wrote:
In any event, the compiler should not need clues like this. It is easy enough to tell if the value of a local variable is not going to be used, regardless of its name. That is usually a programming error, of course: my Lua linter has a specific hook in it to avoid flagging unused local _'s in order to allow this idiom.

Sure, but the important is not to make life easier for the compiler, but to make life easier for the programmer. Why should I have to allocate a new variable, which means coming up with a name that doesn't conflict with any other names in my block, just to put a return parameter in that I'm not going to use? Far better to have syntax that says explicitly that I'm not going to use it. The _ idiom does *part* of this, but it can occasionally trip you up because it doesn't do what you expect it to do.

[insert interesting .sig here]