New EEP draft: Pinning operator ^ in patterns
Eugene
e@REDACTED
Fri Jan 15 15:05:11 CET 2021
On 1/15/21 3:01 PM, Loïc Hoguin wrote:
> On 15/01/2021 14:56, Eugene wrote:
>> On 1/15/21 2:48 PM, Loïc Hoguin wrote:
>>> On 15/01/2021 14:13, Eugene wrote:
>>>>> The absence of this operator might make this more obvious
>>>> how does explicit annotation make anything LESS obvious?
>>>
>>> The warning says "you can't do that", it doesn't tell you why.
>>
>> it is easy to change if you annotate UNbound variables.
>> say
>> "Already Bound"
>> it does tell you everything.
>
> I'm not going to annotate 99.5% of variable matches.
you don't have to.
i will.
> You're not a newcomer. This part of my reply is about teaching newcomers
> Erlang, or newcomers learning Erlang. Examples are important to learn,
> and the badmatch that occurs when trying to reassign a variable is an
> important one to see.
yes. it is not going anywhere!
everything you have you keep.
in addition if you demand a variable to be UNbound,
you will get "already bound" instead of "bad match"
which is way more specific!
More information about the eeps
mailing list