<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">In OTP 21 you could use the map_get/2 guard:
<div><br /></div>
<div>add_prms([{Name, Val}|T], Prms) when map_get(Name, Prms) =:= Val -></div>
</div>
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
Michał.</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">On 26 Nov 2018, 10:57 +0100, Oleg <lego12239@yandex.ru>, wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">Hi, all.<br />
<br />
I try to do the pattern matching in a function definition with maps:<br />
<br />
add_prms([{Name, Val}|T], #{Name := Vals} = Prms) -><br />
<br />
But erlc says me:<br />
<br />
variable 'Name' is unbound<br />
<br />
Is this is not supported yet?<br />
<br />
Erlang/OTP 20<br />
<br />
--<br />
Олег Неманов (Oleg Nemanov)<br />
_______________________________________________<br />
erlang-questions mailing list<br />
erlang-questions@erlang.org<br />
http://erlang.org/mailman/listinfo/erlang-questions<br /></blockquote>
<div></div>
</div>
</body>
</html>