New EEP draft: Pinning operator ^ in patterns

Bach Le thebullno1@REDACTED
Wed Jan 20 04:21:21 CET 2021


Alternatively, don't call it rebind since it implies that the variable has
to exist before.
How about "fresh" **modifier**? (calling it operator seems strange too)
The way I think about it is that Elixir and Erlang having 2 polar
opposites to the "default" behaviour of variables.
If we have to introduce a special **modifier** on variables, it should be
used to invert this default behaviour.

If Elixir has to pin then Erlang has to "unpin"/"refresh"/"fresh"/"forget".

On Wed, Jan 20, 2021 at 11:10 AM Bach Le <thebullno1@REDACTED> wrote:

> I rarely post but this change seems strange.
>
> The rule for Erlang has always been single assignment so I don't think
> pinning is necessary.
> What if we reverse the operator and call it the "rebind" operator?
> Similar to how Elixir has to explicitly pin, Erlang has to explicitly
> rebind.
> Borrow the "spirit" and not the exact thing.
> Let's call it "&" to avoid confusion.
>
> Say in a case expression and you want to introduce a new variable,
> ignoring whatever that has appeared before, use:
>
> case thing() of
>     {ok, &T} -> T
> end
>
> No new error or warning introduced
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210120/82b86c99/attachment.htm>


More information about the erlang-questions mailing list