Internal define is awesome.<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 2, 2012 at 4:17 PM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I guess we should take this also as a confirmation of the style guide :-)<br>
<div><div class="h5"><br>
<br>
On Nov 2, 2012, at 5:05 PM, Danny Yoo wrote:<br>
<br>
> I was just looking at exercise 2.64 of SICP, one that creates a BST out of an ordered list of elements:<br>
><br>
> <a href="http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_thm_2.64" target="_blank">http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_thm_2.64</a><br>
><br>
> However, because of all the nested lets, I have to admit that I was having a hard time reading it!<br>
><br>
> So I rewrote it with the Racket style guidelines in mind <a href="http://www.ccs.neu.edu/home/matthias/Style/style/Choosing_the_Right_Construct.html#(part._.Definitions)" target="_blank">http://www.ccs.neu.edu/home/matthias/Style/style/Choosing_the_Right_Construct.html#(part._.Definitions)</a><br>
><br>
><br>
> The rewritten code is:<br>
><br>
> <a href="https://gist.github.com/4004224" target="_blank">https://gist.github.com/4004224</a><br>
><br>
> with the following changes:<br>
><br>
> 1. Rewrote the packing/unpacking of 2-tuple lists in partial-tree with multiple values.<br>
><br>
> 2. Replaced nested lets with defines.<br>
><br>
> 3. Reordered some of the variables definitions to highlight relationships.<br>
><br>
><br>
> I thought the function itself was neat, and just wanted to share.<br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Grant Rettke | ACM, AMA, COG, IEEE<br><a href="mailto:grettke@acm.org" target="_blank">grettke@acm.org</a> | <a href="http://www.wisdomandwonder.com/" target="_blank">http://www.wisdomandwonder.com/</a><br>
Wisdom begins in wonder.<br>((λ (x) (x x)) (λ (x) (x x)))<br>
</div>