New EEP draft: Pinning operator ^ in patterns

Mon Jan 18 11:34:12 CET 2021

On Mon, 18 Jan 2021 01:44:34 +1300
"Richard O'Keefe" <raoknz@REDACTED> wrote:

> Am I the only one who finds the word "pinning"
> confusing?

No, not now that you have pointed it out. Have read and used it merely like a result of make_ref/0 so far.

Feels a bit like the comma in Lisp macroes: do not evaluate in pattern context unless ...

Speaking of semantics, should this be implem... -- oh! -- ... included:

I suggest the use of `~`.

In dictionaries it means 'refer to the previous value', in format strings it means 'need value, insert value'. And it keeps Erlang and Elixir apart(!), preventing detrimental paradigm context switching by visual association and simple confusion.

I am thinking of all those "curly bracket languages": they all look "the same" but their fly-droppings have confusingly equal, similar or different meanings. Would the Erlang pin-hat (pun intended) be the same as in Elixir? Would it stay the same? Worse! with "assignment" already being used in arguing for it, would it create a desire for reassignment? via some "crying walrus" operator `:,=`? which then created a desire for 'const' to "pin" bindings? Which would then prompt a desire for a "wicked walrus" `>:=` to reassign ....

> It appears to be an ANNOTATION, not an operator,

EEP says "explicitly annotated with the ^ operator"

So someone has not decided yet -- apart from that they want it, and now.

Such things should make everyone look twice -- and think thrice.

If only I had noticed ... or even better: at least some one else, and besides and before you ...


Curiosity killed the cat -
by simply using up its time.

More information about the erlang-questions mailing list