New EEP draft: Pinning operator ^ in patterns

Matt Kowlaczyk matt@REDACTED
Mon Jan 18 20:22:21 CET 2021

Jose Valim wrote a well written blog post titled "Comparing Elixir and
Erlang variables" [1] where he highlights the pin operator in Elixir and
explorers some of it's benefits. He succinctly addresses the class of
bugs of it catches and contrasts the operator with Erlang. Here is a
short snippet,

> In other words, so far Elixir requires you to be mindful of all later
> code after the introduction of a variable while Erlang requires you to
> know all previous and further code before the introduction of a
> variable. The one benefit of Erlang so far is that the code may crash
> explicitly on the match.
> However, things get more complicated when considering case expressions.
Thought this would provide some useful context. It would be interesting
to see how the ideas in Jose's post reconcile under this proposed EEP. I
have not gone through the exercise.


Matt Kowalczyk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: publickey - matt@REDACTED - 2ce7beba.asc
Type: application/pgp-keys
Size: 3060 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 839 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the erlang-questions mailing list