Re: New EEP draft: Pinning operator ^ in patterns

Eckard Brauer <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <[email protected]>
Hey, this arises a next question:

> There is nothing in this suggestion that affects the reuse of the same
> variable within a pattern.
> If it's a new variable that's supposed to have the same value in both
> positions, it would look like before: "{X, X} -> ...".
> If it's an already bound variable that occurs twice in the same
> pattern, you'd mark both instances: "{^X, ^X} -> ...".

That means, a "pinned" variable shall have the exact same binding in
each:

* instruction?
* line?
* something else?

Maybe it's the same Erlang shell behaves currently with _X:

 $ erl
Erlang/OTP 23 [erts-11.1.6] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Eshell V11.1.6  (abort with ^G)
<0.81.0> 1> {_X, _X} = {1,2}.
** exception error: no match of right hand side value {1,2}

So, why change?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.