<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den tis 19 jan. 2021 kl 14:25 skrev Fernando Benavides <<a href="mailto:elbrujohalcon@gmail.com">elbrujohalcon@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Oh! I didn't understand that correctly.</div><div dir="auto">In that case, what would be the meaning of [X, ^X] = something()? Will that even be a valid expression?</div><div dir="auto"><br></div><div dir="auto">I'm assuming that f(X, X) ->... Will indeed need to be written as f(X, ^X) ->..., right?</div></blockquote><div><br></div><div>^X always means a single thing - "the value of X in the surrounding scope". Any unmarked X has the same meaning as today.</div><div><br></div><div>In a simple match expression [X, ^X] = something(), or a case clause "case something() of [X, ^X] -> ..." you'd get a warning about the unmarked X (if you enable the warnings), but it keeps it's existing meaning, which is the same as ^X for these kinds of patterns.</div><div><br></div><div>In a fun head or list comprehension generator pattern, you'd get the usual warning that the unmarked X is shadowing (assuming it has a binding).</div><div><br></div><div>If you do mark a variable as ^X, and it *doesn't* have a previous binding, that's a normal "unbound variable" error, just as if you had written "X1 when X =:= X1 -> ..." and X doesn't actually exist. This means that the clause doesn't accidentally start to match on any value in case you rename X to something else above.<br></div><div><br></div><div dir="ltr"><div><div dir="ltr" class="gmail_signature"><br>        /Richard</div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"></div></div><div> </div></div></div>