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.

[1]
http://blog.plataformatec.com.br/2016/01/comparing-elixir-and-erlang-variables/


-- 
Matt Kowalczyk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210118/c1302d0b/attachment.htm>
-------------- 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: <http://erlang.org/pipermail/erlang-questions/attachments/20210118/c1302d0b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 839 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210118/c1302d0b/attachment-0001.bin>


More information about the erlang-questions mailing list