<div dir="ltr">Hi!<div><br></div><div><span style="font-size:12.8px">X#myrec{f0 = F} = Y.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">regards,</span></div><div><span style="font-size:12.8px">Vlad</span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 12, 2016 at 2:46 PM, Matwey V. Kornilov <span dir="ltr"><<a href="mailto:matwey.kornilov@gmail.com" target="_blank">matwey.kornilov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hello,<br>
<br>
I have the record definition with a lot of fields, so it is pretty long record.<br>
<br>
-record(myrec, {f0, f1, f2, f3, .....}).<br>
<br>
Let X and Y be two records of this type.<br>
I can not understand how should I do the following pattern matching.<br>
<br>
I want all fields of X and Y be the same, except f0, and f0 should be bound to new variable F. As there are a lot of fields I don't want to explicitly enumerate them in my code in order DRY.<br>
<br>
In other words I need a short form of:<br>
#myrec{f0 = F, f1 = X#myrec.f1, ...} = Y.<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>