New EEP draft: Pinning operator ^ in patterns

Kenneth Lundin kenneth@REDACTED
Mon Feb 1 15:11:34 CET 2021


On Thu, Dec 24, 2020 at 9:10 PM Richard Carlsson <carlsson.richard@REDACTED>
wrote:

> The ^ operator allows you to annotate already-bound pattern variables as
> ^X, like in Elixir. This is less error prone when code is being refactored
> and moved around so that variables previously new in a pattern may become
> bound, or vice versa, and makes it easier for the reader to see the intent
> of the code.
>
> See also https://github.com/erlang/otp/pull/2951
>
> Ho ho ho,
>
>         /Richard & the good folks at WhatsApp
>

The OTP team had a meeting about EEP 55 and the corresponding pull request,
"Pinning operator ^ in patterns" and
we came to the following conclusion.

We will not approve this pull request for inclusion in OTP 24. OTP 24 will
be released in May and
before that there will be 3 release candidates with the first one on
February 24:th.

We agree that there is a problem that binding when match was intended, and
vice-versa,
is a source of error especially in big projects with many beginners and
large functions.
This can be worth to solve.

But we need to investigate this more before OTP 25 in order to take a
decision.
We also note that if a change like this should be released many other
things must be in place before an introduction.
Things such as: Erlang editor modes, other tools, documentation, examples,
test suites. parse transforms, ...

/Kenneth Erlang/OTP Ericsson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/eeps/attachments/20210201/b0d9b1ab/attachment.htm>


More information about the eeps mailing list