New EEP draft: Pinning operator ^ in patterns

Mikael Karlsson karlsson.rm@REDACTED
Fri Dec 25 12:05:45 CET 2020


OK, I never get those ":" right, this_parrot was not meant to be an atom
but a variable.
this_parrot = ... etc.

Den fre 25 dec. 2020 kl 11:41 skrev Mikael Karlsson <karlsson.rm@REDACTED>:

> You are not pulling legs with a Christmas joke now Richard?
> It looks too ambitious to be that, but I cannot get rid of the feeling.
>
> elixirian: :this_parrot = :alive
> erlanger: :this_parrot = :now_destructed
> elixirian: :this_parrot = :no_no_only_de_con_structed
>
> ho ho ho,
> Mikael
>
>
> Den tors 24 dec. 2020 kl 21:10 skrev Richard Carlsson <
> carlsson.richard@REDACTED>:
>
>> 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
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20201225/da9fa3be/attachment.htm>


More information about the erlang-questions mailing list