That's a great point. The whole idea of warnings is to call attention to
syntactically valid code which is probably not what the developer
intended. The canonical example of warnings in C code is
if (x = 1)
{
/* Do something */
}
For those of you unfamiliar with C that code is valid but instead of
comparing x to 1 it assigns 1 to x which is always true. As I say it's
perfectly legal code and very easily overlooked but probably not what the
developer wants to happen. Warnings are meant to call out code that may be
unintentionally incorrect.
To Josh's earlier point - - yes this could be caught by a linter. I don't
have a strong feeling either way and now that I have made that mistake once
I probably won't make it again. I was thinking of others who might make
this mistake in the future.
On Tue, Jul 12, 2016, 4:18 PM Wiebe-Marten Wijnja <[email protected]>
wrote:
> Declaring variables without underscores in their names as function
> parameters but then not using them inside the function is also perfectly
> valid, but a warning is thrown.
>
> I can think of no use-case of ~w{} that involves commas at the end of the
> words. If you combine commas at the end of words with ~w{}, your code is
> very easy to be misinterpreted by other people.
>
>
>
> On Tuesday, July 12, 2016 at 8:00:45 PM UTC+2, Tallak Tveide wrote:
>>
>> I wouldnt emit a warning here as adding commas should be perfectly valid.
>> How would we deal with the use case where you wanted to include the commas?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elixir-lang-core" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elixir-lang-core/tmAESH8Nhz8/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/2ef950d9-47c6-4e51-bab4-4a907f5dde12%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/2ef950d9-47c6-4e51-bab4-4a907f5dde12%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/CAP%3DvNq_wapwnrHgMUT0PxdMC5JdARg-K9xVuuWER4V5NyCQE_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.