New EEP draft: Pinning operator ^ in patterns
Thu Jan 21 23:28:16 CET 2021
I hesitated a long time to raise my voice at all, because I'm subscribed
to this mailing list as a friendly reminder to get into Erlang/OTP. So no
real experience at all.
So far I really liked, that it seemed to me, that the Erlang/OTP has strict principles.
Disregarding the EEP draft:
The extend of this discussion by itself makes me
doubt, if I would be in good hands when I'd ask for some opinion or help.
Regarding the EEP:
I get the problem, it tries to solve. I don't dislike the way it's
trying to solve it while being sceptical about some things. But I'm not
sure about the presentation of it. Might look to someone like it's about yes or no instead of if and how.
Regarding the discussion:
Why the hell are you so destructive?
Sure it's better to keep funs compact, easy to look at and
whatever was said so often before. For those, who do that, this operator
might be kind of pointless. For those, who don't, or for some reason can't, Erlang might still be the language of choice and a feature
like that could make sense.
A warning about the possibility of trying to assign another value to a variable, while it's actually being matched against might be considered a useful feature.
I get, why it's often interpreted as a yes/no thing right here, but a
part of the discussion, if it should be adopted, should be, if it
could be changed in a way that might be fine.
If the EEP gets adopted, I'd appreciate another operator instead of '^'
by the way. There are cases, in which you might want to use characters
like 'ê' next to that operator, which would make me type '^^' or '^ ' to get a single '^'.
On 24.12.20 21: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 https://github.com/erlang/otp/pull/2951
> Ho ho ho,
> /Richard & the good folks at WhatsApp
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
More information about the erlang-questions