title: Erlang: Is there a way to pattern match a record in a receive clause?
body: <p>I want to do a selective receive where a record property needs to be matched, but whatever syntax I try, I get an "illegal pattern" message.</p>
  
  <pre><code>loop(State) -&gt;
    receive
      {response, State#s.reference} -&gt; do_something()
    end.
  </code></pre>
  
  <p>Is this not possible?</p>