<p>Hi David.</p><p>Thanks for the prompt reply. Could you explain the details of your answer? I interpreted the structure of this form of pattern matching as:</p><p>Person={person,{name,{first,joe},{last,armstrong}},{footsize,42}}.</p>
<p>{person,_,{name,_{first,_{last,_}},{footsize,_}=Person.</p><p>Is this correct? From left to right, one counts the atoms, i.e., person,name,first,last,etc. and 'aligns' them with the underscores?</p><p>Thanks again,</p>
<p>Caitlin</p><p> </p><p> <br></p><br><div><span class="gmail_quote">On 6/18/08, <b class="gmail_sendername">David Mercer</b> <<a href="mailto:dmercer@gmail.com">dmercer@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">









<div lang="EN-US" link="blue" vlink="purple">

<div>

<p><span style="font-family:Consolas;color:navy">1>
Person={person,{name,{first,joe},{last,armstrong}},{footsize,42}}.</span></p><span class="q">

<p><span style="font-family:Consolas;color:navy">{person,{name,{first,joe},{last,armstrong}},{footsize,42}}</span></p>

</span><p><span style="font-family:Consolas;color:navy">2>
{_,{_,_,{_,Last}},_} = Person.</span></p><span class="q">

<p><span style="font-family:Consolas;color:navy">{person,{name,{first,joe},{last,armstrong}},{footsize,42}}</span></p>

</span><p><span style="font-family:Consolas;color:navy">3> Last.</span></p>

<p><span style="font-family:Consolas;color:navy">armstrong</span></p>

<p><span style="color:navy"> </span></p>

<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">

<div>

<div align="center" style="text-align:center">

<hr size="2" width="100%" align="center">

</div>

<p><b><span style="font-family:Tahoma">From:</span></b><span style="font-family:Tahoma"> <a href="mailto:erlang-questions-bounces@erlang.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">erlang-questions-bounces@erlang.org</a>
[mailto:<a href="mailto:erlang-questions-bounces@erlang.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">erlang-questions-bounces@erlang.org</a>] <b>On Behalf Of </b>Caitlin
Gibbons<br>
<b>Sent:</b> Wednesday, June 18, 2008 13:37<br>
<b>To:</b> <a href="mailto:erlang-questions@erlang.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">erlang-questions@erlang.org</a><br>
<b>Subject:</b> [erlang-questions] Help with tuple pattern match?</span></p>

</div><div><span class="e" id="q_11a9cfc51d5ace31_5">

<p> </p>

<p style="margin-bottom:12.0pt">Hi all.<br>
<br>
I'm looking at:<br>
<br>
Person={person,{name,{first,joe},{last,armstrong}},{footsize,42}}.<br>
<br>
and trying to extract the value of 'last', i.e., 'armstrong'.<br>
<br>
{_,{_,{_,{_,Last},_}=Person.<br>
<br>
was unsuccessful. Any help?<br>
<br>
Thanks,<br>
<br>
Caitlin</p>

</span></div></div>

</div>

</div>


</blockquote></div><br>