|
|
|
|
|
by Tyr42
2190 days ago
|
|
Which equality will you use if it's not numbers, but something more complicated. What if `(x, y, x)` is matched against some `(a, b, c)` where `a == c`, but not `a is c`? If yes, and you mutate `x` in the body, does it mutate `a` or does it mutate `c`? I think at least making it an error now can leave it open to defining it later. |
|
(Elixir has a similar operation to "pin" in a match: if you use an existing variable as the pattern, but pin it, the value must match whatever the variable is already bound to.)
> I think at least making it an error now can leave it open to defining it later.
Fair point.