New EEP draft: Pinning operator ^ in patterns
Tristan Sloughter
t@REDACTED
Thu Dec 24 23:36:53 CET 2020
I'd much prefer if `^` was used to allow rebinding. But I know that would be too confusing since Elixir went with ^ to mean regular binding. So maybe `!`?
But this change just lets you add the `^` while not changing how anything works? That sounds like it'll cause a lot of confusion when reading since sometimes a bind is using `^` and sometimes they aren't but it is doing the same thing...
On Thu, Dec 24, 2020, at 13:10, Richard Carlsson 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
>
> Ho ho ho,
>
> /Richard & the good folks at WhatsApp
>
> *Attachments:*
> * eep-00xx.md
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20201224/70ca814d/attachment.htm>
More information about the erlang-questions
mailing list