New EEP draft: Pinning operator ^ in patterns

Wojtek Surowka wojteksurowka@REDACTED
Fri Jan 22 12:29:21 CET 2021


> So I took the pinning branch for a spin and ran it against the Ra library (https://github.com/rabbitmq/ra/pull/209) I have worked a lot on the last few years. I found 2 bugs and at least a couple of places where I am not really sure about the intent of the match and where it could be done better. At some point I will run it against the RabbitMQ code. Who knows what I will find there! 
So thank you Richard, I take my hat (pun intended) off to you for this feature and for standing up for it against the onslaught of negativity around it. For me this feature, ad-hoc or not, addresses a real problem and will result in fewer bugs which makes me prepared to deal with any syntactic overhead it may carry.

This is once again argument for adding the warning, not for the new pinning operator. I think it was really smart move to connect the two, because many people may react in the same way: non-controversial part of the change helped me with my code, so the entire change is good.

I do not think anyone here argued against the warning - provided it could be disabled by people who don't want it. The real discussion is about a potentially backward incompatible change in Erlang language. The syntax of this change does not look like anything else in the language, there is nothing similar, I think it can be safely said that it does not follow the conventions of Erlang syntax. Of course proponents of the change may say that conventions are not written in stone and can evolve, but I think it is important to be clear about it. I assume that the syntax is taken directly from Elixir, which is on syntactic level a very different language. Importing some random parts of Elixir syntax into Erlang won't turn Erlang into Elixir completely, but it will turn Erlang into worse language.

I wonder if it is possible to split the proposal into warning part and operator part, so the intentions and results are clearer.

-- 
Wojtek



More information about the erlang-questions mailing list