Re: New EEP draft: Pinning operator ^ in patterns
"Tristan Sloughter" <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <[email protected]> |
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