New EEP draft: Pinning operator ^ in patterns
Fri Jan 15 18:29:57 CET 2021
On 2021-01-15 18:07, Loïc Hoguin wrote:
> I don't object to at least have this experimental as I've indicated before.
> Perhaps using this feature would confirm or remove concerns.
The problem with that kind of experiment is that it is significantly harder to
remove it once it is there. Saying no to features is hard in the open source
ecosystem, and it is even harder if it is already implemented and distributed,
experimentally or not. This kind of process leads to a senseless accumulation
of features and a more complex language.
However I would second your earlier suggestion regarding implementing this
kind of warning in code editors. I would also be perfectly fine with a
compiler flag, disabled by default, which reports warnings for existing
bindings used in patterns. This way, developers who do not like this mechanic
would be able to forbid it in their codebase, without affecting other
developers. Thinking about it, I fail to see the point of modifying the
language when a compiler flag would do the trick. -Wshadow in C compilers does
something similar, and I do not see anyone asking for an annotation to allow
selective variable shadowing.
More information about the erlang-questions