New EEP draft: Pinning operator ^ in patterns

Raimo Niskanen raimo+eeps@REDACTED
Fri Jan 22 17:27:13 CET 2021


On Fri, Jan 22, 2021 at 01:22:02PM +0100, Eugene wrote:
> On 1/22/21 9:25 AM, Richard Carlsson wrote:
> > In many normal cases, the ^-annotation can look superfluous.
> 
> show me an example where annotating an *UNbound* var
> is not useful.

foo() ->
    ^A = 2,
    A.

If that is what you ment; annotating every time a new variable is bound
is not practical, because binding is much more common than using
a variable in pattern matching.  It is better to annotate the exceptions
from the normal.

I think this motivation has been stated several times before.

Best regards
-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB


More information about the eeps mailing list