<div class="im" style="color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><span style="color:rgb(34,34,34)">One problem with short examples is they mask the reason for the code to</span><br style="color:rgb(34,34,34)"><span style="color:rgb(34,34,34)">be structured that way. </span></div><font color="#888888"><br>
</font></blockquote></div><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">Couldn't agree more (I don't think I've ever written a nested function outside a closure). I made the assumption that the OP wasn't asking about closures based on his code samples. In hindsight, should have likely asked for clarification first.</div>